I wonder how to know when a line of code was added to a GitHub repository.
I'm looking for commit hash so I could add a comment on this line of code (instead of opening an issue)
For example I have to know when this line
https://github.com/username/project/blob/master/path/to/file#L6
was added
So I could using https://github.com/username/project/commit/COMMIT_HASH
add a comment about this line.
Directly on GitHub, the button "blame" can give you the last commit having modified that line.
But not the first commit.
For that, you need to clone the repo and use a git log -L
:
git log --pretty=short -u -L 6,6:afile.txt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With