+1 vote
1 view
in Devops and Agile by (25.5k points)
edited by

When I do 

git diff COMMIT

I see the changes between that commit and HEAD (as far as I know), but I would like to see the changes that were made by that single commit.

I haven't found any obvious options on diff/log that will give me that output.

1 Answer

0 votes
by (42.7k points)
edited by

To see the changes between two commits use

git diff COMMIT~ COMMIT

This will show you the changes between its previous commit and this commit. 

For details go through- https://gitirc.eu/git-diff.html

git show COMMIT 

Will show you commit’s data, including diff - but not merge commits.

For more information please go through the following tutorial to get more info about git:

by (5.8k points)
Worked for me. Thanks.
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...