in Git by
Q:
How will you find out what all files have been changed in a particular Git commit?

► Click here to show 1 Answer

0 votes
by

By using the hash value of the particular commit, you can execute the below command to get the list of files that have been changed in a particular commit:

git diff-tree -r {hash}

This will list down all the files that have been modified, and also the files that have been added. The -r flag is used to list individual files along with their path instead of collapsing them in their root directory names only.

You can also use the below command:

git diff-tree –no-commit-id –name-only -r {hash}

–no-commit-id will retrain the commit hash numbers to come in the output. Whereas, -name will exclude the file paths and only give the file names in the output.

GIT
Learn More with Madanswer

Related questions

0 votes
asked May 21, 2020 in Git by SakshiSharma
...