I got one file removed in the repository. I want to find out on which commit this file is removed. How can I do this?
git rev-list -n 1 HEAD -- <file_path>
This will return the hash of the last commit that has modified this path. If your file does not exist in HEAD anymore, it means that it will return the hash of the deleting commit.
Good luck
git log -p -1 -- <file_path>
It will show the detail of the commit.
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