Categories

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

1 Answer

May 21

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.

Click here to read more about GIT
Click here to read more about Insurance

Related questions

Madanswer
May 21 in Git
Oct 15, 2019 in Git
Oct 26 in Git
...