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).

98 questions
364
votes
6 answers

What does 'git blame' do?

I saw a lot of questions about methods of using git blame, but I don't really understand them. I see a Blame button on top of files on the GitHub interface. Upon clicking it, it shows some diff with usernames on the left bar. What does that…
Himanshu Mishra
  • 6,634
  • 10
  • 32
  • 71
70
votes
4 answers

Where is git-blame in SourceTree

I'd like to see who contributed which line/change to a file. git-blame does exactly that. So does SourceTree have a git-blame view?
wnrph
  • 3,005
  • 3
  • 23
  • 36
48
votes
2 answers

Why git blame does not follow renames?

$ pwd /data/mdi2/classes $ git blame -L22,+1 -- utils.js 99b7a802 mdi2/utils.js (user 2015-03-26 21:54:57 +0200 22) #comment $ git blame -L22,+1 99b7a802^ -- utils.js fatal: no such path mdi2/classes/utils.js in 99b7a802^ As you have noticed,…
Eugen Konkov
  • 15,716
  • 7
  • 69
  • 107
41
votes
7 answers

How to Git Blame/Authors a previous revision with Xcode 11?

With Xcode 10.2, I could select the "Authors" view, then select a previous git revision to blame from the bottom picker: But with Xcode 11 beta, when I select the "Authors" view, I'm unable to select a past revision to blame because the picker is…
Cœur
  • 32,421
  • 21
  • 173
  • 232
33
votes
1 answer

How to get to know about developer code blame in android studio

I am working on project which is shared by few developers, how to get to know about developer blame in android studio?? any shortcuts or any idea? which will help us to know about code blame.
Vinod Pattanshetti
  • 2,011
  • 1
  • 17
  • 32
26
votes
2 answers

Git commit that doesn't override original authors in git blame

I've used a perl script to modify all tab characters in a php git repository and changed them all to 4 spaces. $ find -iname \*.php -exec perl -pi -e "s/\t/ /g" {} \ I can commit this change with git commit, but it will mark me as the author of…
nookni
  • 263
  • 3
  • 6
20
votes
1 answer

Combine `cloc` with `git blame`

cloc enables one to count the number of lines of code stored in a directory per language per type (blank, comment, or code). git blame enables one to see which part of a file belong to whom. I'm looking for a way to combine both so that one gets a…
Willem Van Onsem
  • 321,217
  • 26
  • 295
  • 405
18
votes
3 answers

git blame on windows reports "fatal: no such path in HEAD"

When I run git blame on a file in a folder e,g,: git blame Foo/FileA.txt it returns fatal: no such path 'Foo/FileA.txt' in HEAD I can clearly see that this file exists on the file system, and other files in the same folder can be successfully blamed…
James World
  • 27,233
  • 7
  • 80
  • 112
17
votes
2 answers

Find all current lines modified by an author

How would I in git determine all lines still in existence that were from a specific author. Say for example, a Tony had worked on my project and I wanted to find all lines in my develop branch that still exists and were from a commit that Tony…
stevebot
  • 21,481
  • 26
  • 107
  • 176
13
votes
2 answers

IntelliJ annotate vs git blame

I am using IntelliJ's annotate feature to see in the editor who last changed a line in a file. Now I am using JGit to read the same annotations and they differ. For me it seems that Intellij checks that a line has not been changed between commits…
11
votes
3 answers

Git tracking block of code moved/removed in a file

I have an old commit md5hash on myfile.extension with SOME CHANGE in the commit body (not the commit title/metadata). How can I generate a list of commits with SOME CHANGE modified (not just present) in the commits leading up to HEAD from md5hash…
sjakubowski
  • 2,843
  • 23
  • 34
10
votes
3 answers

Find first existence of a line of code in Git

I am trying to trace a piece of code (just a single line) to it's commit. Using blame only points me to a commit where this line in question was moved as a part of an extract method style refactoring. What techniques can I use to get to the commit…
zadam
  • 2,376
  • 2
  • 22
  • 31
9
votes
3 answers

git blame of particular lines inside all files filtered with grep command

I know how to run gblame inside a file. I know how to grep a content inside all files in a directory. I'd like to see gblame of particular lines around that one that contains a content. Example: $ blame -R "content" ./ I see a list of files. I want…
sensorario
  • 15,862
  • 24
  • 85
  • 131
9
votes
1 answer

Vim Fugitive: Gblame reblame options

I've been using Fugitive's Gblame recently but don't quite understand what "reblame" does. Can someone describe a little more clearly what these options do: - reblame at commit ~ reblame at [count]th first grandparent P reblame at…
Jonathan.Brink
  • 19,445
  • 13
  • 59
  • 98
8
votes
1 answer

Git: Equivalent of `--full-history` for `git bisect` and `git blame`

I've been using Git heavily for about 7 years. A few days ago I found a behavior that surprised me. I found git log, git blame and git bisect to exhibit this weird behavior. A friend let me know about the --full-history flag to git log that solved…
Ram Rachum
  • 71,442
  • 73
  • 210
  • 338
1
2 3 4 5 6 7