github - Can git tell me the current line number corresponding to a line number in an old commit? -


a bit of code in file.py on line 705 in old commit, created branch. since then, master has progressed , file.py has been modified, inserting 50 new lines near top. now, in branch modify file.py's line 705, , commit. merge branch master. git automagically knows change goes on line 755 in current file.py. there way can provide information without making change? is, given oldcommit:file.py:705 want produce master:file.py:755.

i prefer solution using github's web-based tools , api, if need use command line git suffice.

according git blame man page:

-n, --show-number: show line number in original commit (default: off).

so git blame -n file.py add line number of line in blamed commit.


Popular posts from this blog