Git: Differences since a commit

236 views Asked by At

Given this output:

c:\git\xxx>git log --oneline -n 5    
b99c981 Merge remote-tracking branch 'origin/xxx-newfeature' into xxx-blah
e53f30a [maven-release-plugin] prepare for next development iteration
e40978b [maven-release-plugin] prepare release xxx-3.9.6
0639706 Modified Ant installion path
654ef47 [maven-release-plugin] prepare for next development iteration

What are the GIT diff commands to see:

  1. What changed in just commit 0639706
  2. What changed in all commits since (and including) commit 0639706

Note I've been using git difftool to view the diffs visually (when I can figure out what I'm diff'ing..)

2

There are 2 answers

3
dpk2442 On BEST ANSWER

For the first one, try

git show 0639706

Alternatively, you could do

git diff 0639706~1 0639706

For the the second one,

git diff 0639706~1

should do the trick. If you are only interested in seeing the file names, rather than the entire diff, you can use the --name-only option with either command.

1
larsks On

Assuming that by "what changed" you mean "produce diff output detailing the changes":

What changed in just commit 0639706

git show 0639706

What changed in all commits since (and including) commit 0639706

git log -p 0639706