I am troubleshooting a problem where something that used to work, does not, all of a sudden. Given a sha1, how can i find out what files changed as part of it?
Any of these should work:
git diff-tree --no-commit-id --name-only -r <COMMIT_SHA1>
git show --pretty="format:" --name-only <COMMIT_SHA1>
Example output:
foo
bar
baz
To also show the status of each file in the change, use --name-status option instead:
git diff-tree --no-commit-id --name-status -r <COMMIT_SHA1>
git show --pretty="format:" --name-status <COMMIT_SHA1>
Example output:
A foo
M bar
D baz
git show --name-only <the-hex-sha1-string> should do the trick.
Here I assume that sha1 you mention is the sha1 signature of the commit.
Consider reading about git bisect for further troubleshooting.
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