Imagine a class within a git project that has undergone 1000’s of commits, re-visited over and over. Is there any chance for me to examine when exactly (at which commit) a specific line of code was introduced to the class ?
If not, is there an alternative to going towards each commit to find the set of lines that I have a particular interest in ?
Ty.
You can use
git bisectto backtrack when certain code was introduced (see http://git-scm.com/book/en/Git-Tools-Debugging-with-Git) and could use this technique to check out the code each time and then see if the line is yet present. This makes the search O(log n) instead of O(n), which saves you a lot of time…If you want to know when a line is last edited, you can use
git blame.