I have a file in a Git project that had a specific value changed at some point by someone; I don't know who or when. I want to find when the change was made, but I'm not sure how I can track that in Git.
I've tried using git diff <sha1> <sha2>
, but that shows the differences for the entire project, while I want to check one particular file.
git blame
should help you. git blame <file>
will show you <file>
, line by line, and include on each line which user last changed that line, and in which commit.
You could try:
git log --all -S oldvalue filename
This will list all commits where "oldvalue" changes (added or deleted)
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