In a git repository used by many people, I found some code code I'm interested in, but it's not fully fleshed out.
I have no way of knowing whether this is a recent or old change, so I hesitate to just browse back through all commits on the file.
Is it possible find when the line of code appeared in the repository so I can talk to the original person who posted it?
This is the perfect case for
git blame
.As per its man page
You can use it like follows
Optionally (advisable, I'd say) you can output the result on a file
and open the file with any editor supporting the
git blame
syntax. I use for instance Sublime Text 2.Other tips from comments:
will start a basic gui interface, which can be helpful.
Also
will show only line 42, in case you are interested in a specific line.