tags:

views:

51

answers:

2

I need to generate a patch of commit with respect to its base. A tag has been marked on that commit. So like on 939023 I do a commit and now it becomes 213232, I will tag 213232 with a label. Now given the label, I need to find out the diff between the 213232 and 939023.

I mean I need a way to generate a diff of any commit whose label is given to its base.

Any ideas?

+2  A: 
git diff 939023..213232
Michael Steele
Or just `git diff 939023 213232` (the dots are syntactic sugar)
Jakub Narębski
+2  A: 
git diff <commit> <commit>~

That will show the difference between a commit and its parent (assuming that you mean the parent when you say “base”).

Shorter version:

git show <commit>
Bombe
Or `git diff <commit>^!`
Jakub Narębski