tags:

views:

101

answers:

3

A stupid way I know is:

git diff commit-number1 commit-number2

any better way?

I mean I want to know the commit1 itself, I don't want to add the commit2 before it as parameter.

+1  A: 

This is one way I know of. With git, there always seems to be more than one way to do it.

git log -p commit1 commit2
1800 INFORMATION
+4  A: 

Does

$ git log -p

do what you need?

Check out the chapter on Git Log in the Git Community Book for more examples. (Or look at the the documentation.)

Update: As others (Jakub and Bombe) already pointed out: although the above works, git show is actually the command that is intended to do exactly what was asked for.

Mark van Lent
Thanks. git log -p commit-number works well.
arsane
+7  A: 
git show <commit-id>
Bombe
works well too!:)
arsane