Questions tagged [git-blame]

git-blame is a git command that shows what revision and author last modified each line of a file.

git-blame is a git command that shows what revision and author last modified each line of a file.

https://www.kernel.org/pub/software/scm/git/docs/git-blame.html

git annotate is almost an alias for git blame (the output format is slightly different).

115 questions
2
votes
2 answers

Git: How to restore a file history blame track after changed its EOL?

we have some files originally created under Windows with EOL (CRLF) and others with Linux (LF), sometimes the IDE (or a bad configured Git after a fresh reinstall) changed those EOL overriding and making us lose the entire history of the files…
FiruzzZ
  • 661
  • 1
  • 6
  • 21
2
votes
1 answer

git blame: count amount of characters contributed by a developer (tracking renames)

For certain statistical purpuses I need to precisely count the amount of characters contributed by a developer to the current state of a git repo (HEAD). The closest I could get was this command: wc -m `git log --no-merges --author="SomeDev"…
user1876484
  • 610
  • 6
  • 16
2
votes
1 answer

Remove filename and timestamp from git-blame

Long filepaths and unneeded timestamps are making it hard for me to read the output of git blame. I'd like to remove these columns from the output, but keep the SHA, line number, and author name. I see in the docs that the -f or --show-filename…
Richie Thomas
  • 3,073
  • 4
  • 32
  • 55
2
votes
0 answers

"+" character in file name causes git blame to fail

I run a command git blame --show-email foo.txt and it works. But I run another command git blame --show-email foo+bar.txt and get: fatal: no such path 'ParentDir/Foo+Bar.txt' in HEAD I ran a panoply of googles for "git blame + character error",…
Alex Bollbach
  • 4,370
  • 9
  • 32
  • 80
2
votes
1 answer

Git blame -C -C does not seem to work

In the git documentation of the blame command it says that (emphasis mine): C[< num >] In addition to -M, detect lines moved or copied from other files that were modified in the same commit. This is useful when you reorganize your program and move…
user42768
  • 1,951
  • 11
  • 22
2
votes
1 answer

How to find overlapping Git commits

I'm doing a kind of archeology for my team's Git repo. The goal is to find all overlapping commits, e.g. all pairs of commits touching the same lines of code. I tried to do this with diff and blame commands. The first one is not that reliable since…
Wladd
  • 21
  • 4
2
votes
2 answers

git: How to find file history from blob ID

I'm trying to replicate Subversion's $Id: $ feature with git. I know that I can use .gitattributes to set the ident attribute, which will allow me to embed the blob ID in a source code comment. That's the basic requirement, and I'm covered. But I'm…
Paul Moore
  • 6,569
  • 6
  • 40
  • 47
2
votes
0 answers

Can I make large changes to a git repo without rendering git-blame useless?

So, let's say I have a repo and it's development has been... organic. In an effort to wrangle things, I've instituted coding standards with attendant linting files. I'm using a nice linter that is able to fix a lot of the mundane issues…
Dancrumb
  • 26,597
  • 10
  • 74
  • 130
2
votes
4 answers

git: number of lines *not* changed since specific commit?

There are plenty of answers with great command line fu to find changes (or change statistics), but I'd like to find the opposite: how many lines (per file) have not changed since a particular commit? The closest I could find is this: How to find…
Steffen G.
  • 195
  • 1
  • 9
2
votes
0 answers

What do "Originally By" and "Copied Or Moved Here By" mean in Git Gui Blame?

Normally when I hover over lines in Git Gui Blame, it shows a tooltip containing just the commit hash, the author/date, and the comment. But I just saw a tooptip that shows 2 commits - titled "Originally by", and then "Copied Or Moved Here…
sashoalm
  • 75,001
  • 122
  • 434
  • 781
2
votes
1 answer

GIT Diff with blame or source SHA

We feel we do a good job or reviewing each commit before merging in to master. However when we are ready for a new software release I often take one more review. I diff the last production release against the current production candidate. As I…
personalt
  • 810
  • 3
  • 13
  • 26
2
votes
1 answer

See who last changed a specific line in a Git repo

I have use git blame and git log file.py to find changes, but is there a way to see the changes on a specific line on a file? For example: Line 84 on file index.html.
irm
  • 4,073
  • 6
  • 28
  • 32
1
vote
0 answers

Git commit without changing author

I'm planning to migrate a library that is heavily used in our repository to another library which will need me to replace lines in hundreds of files. I'd like the author to not change for this commit. How can I go on about doing this?
dev-rifaii
  • 217
  • 2
  • 9
1
vote
0 answers

git automatically ignore commits by file

I'm using the following command for git to ignore commits listed in .git-blame-ignore-revs git config blame.ignoreRevsFile .git-blame-ignore-revs This file is tracked in a remote git repo. Every developer has to set up this command manually on…
caco jr
  • 27
  • 3
1
vote
1 answer

How does git create a file blame?

I recently learned about git blame and what it does. I want to know how git finds when each line was changed in a file, even across file renames. In other words, I want to know how the blame algorithm works.
Rak Laptudirm
  • 174
  • 2
  • 13