How do you show the list of files that were changed in a specific commit, along with the commit message?
Posted by EveClark
Last Updated: July 13, 2024
To show the list of files that were changed in a specific commit along with the commit message, you can use the git show command. Here's how to do it: 1. Open your terminal or command prompt. 2. Navigate to your Git repository using the cd command. 3. Use the following command, replacing COMMIT_HASH with the actual hash of the commit you're interested in:
git show COMMIT_HASH
This command will display the commit message along with the changes made in that commit and a summary of the files that were modified, added, or deleted.
Example:
If the commit hash is abc1234, you would run:
git show abc1234
Additional Options:
- If you want a more concise overview, you can use:
git show --stat COMMIT_HASH
This command will show a summary of changes, including the number of insertions and deletions for each file without showing the full diff. - To only see the list of files that were modified in the commit without the diff, you can use:
git diff-tree --no-commit-id --name-only -r COMMIT_HASH
This will just output the names of the files that were changed in that commit. Using these commands, you can easily view the files and commit messages related to specific commits in your Git repository.