1

I have a git repository (actually a git-svn repository), I created a new branch and made several commits. on the local branch. Now I would like to get diff between all commits made on the branch. Lets say I have 5 commits between the original state and the current state:

2792959ffd30fc54f56f82fa786b3bd9396e607a
c006fcd294957761dcced3c88760c357af1c3613
05d16d49def746b24f74e1306e16999f13e90027
2d87f52dbe82df507a29a725b0f954c6d7abfc82
66af1018d4f5621a7d021f98dc392e80ca826d35

Then I want to have a listing of all four (4) indicidual diffs between each commit, in SVN version (i.e. as if you had createed the diffs with svn diff).

To be precise: I want to see

  1. The commit message for each commit
  2. The differences made in the various files that has changed
  3. Optionally: git commit hash
DanielSank
  • 3,303
  • 3
  • 24
  • 42
Alex
  • 41,580
  • 88
  • 260
  • 469
  • what is wrong with `git log $somehash..$otherhash`? you do not have to use actual hashes, you can also use `HEAD` and `HEAD^`... – mnagel Jul 08 '13 at 16:10
  • Because with log I only see the log messages. I want to see the diffs for each commit... – Alex Jul 08 '13 at 16:11
  • and with `--full-diff` – mnagel Jul 08 '13 at 16:12
  • do you want to see 4 separate diffs in one command or do you want to see 1 diff containing the changes from all 4 commits? – mnagel Jul 08 '13 at 16:46

3 Answers3

0

To get a full list of what has changed between two branches or two commits you can use git whatchanged

i.e.

git whatchanged -p 66af1018d4f5621a7d021f98dc392e80ca826d35 2792959ffd30fc54f56f82fa786b3bd9396e607a

The -p flag tells git to use the textual diff rather than a hexadecimal diff. See https://www.kernel.org/pub/software/scm/git/docs/git-whatchanged.html

mproffitt
  • 2,409
  • 18
  • 24
0

i think you can simply do

git log --full-diff $somehash..$otherhash

and you can use HEAD and HEAD^ instead of full hashes to refer to commits.

mnagel
  • 6,729
  • 4
  • 31
  • 66
0

possibly even better:

git show $somehash
mnagel
  • 6,729
  • 4
  • 31
  • 66