9

I've been looking into git diff and git log options to find a way to trace a given source code line history in the repo (branches, authors, commit messages, etc.) but i don't see anything like this.

Are there third-party git tools that can accomplish this?

lurscher
  • 25,930
  • 29
  • 122
  • 185
  • Can this help you? http://stackoverflow.com/questions/2700140/how-do-i-search-git-history-for-a-disappeared-line – frbry Jun 01 '12 at 16:54
  • 1
    I think what you are looking for is `git blame`. – vcsjones Jun 01 '12 at 16:54
  • Look at http://stackoverflow.com/a/8436707/236871 and http://stackoverflow.com/a/8436006/236871 – KurzedMetal Jun 01 '12 at 16:57
  • `git blame` tells you who's responsible for each line in a given (usually current) incarnation of a file. But it doesn't tell you how a given line changed over time, which is not wholly unreasonable since the line might move around files, etc. The problem is 'what constitutes the same line in two different versions of the file. – Jonathan Leffler Jun 01 '12 at 17:00

1 Answers1

0

you want

git blame

If the line of code came from another file at some point in history and you want to track that, you can

git blame -M
Adam Dymitruk
  • 124,556
  • 26
  • 146
  • 141
  • 16
    I think what he wants is to be able to look at multiple git blames, essentially. I.e. find a list of commits where a specific line changed. – Ibrahim Mar 14 '13 at 05:07