Diff between two commits

3

I am doing git diff between two commits and in general it shows me the difference between files that have been modified in these commits.

EX:

git diff 1a1a1a 4d4d4d

+              Essa linha foi adicionada
-              Essa linha foi removidada

This works perfectly, and I have nothing to complain about. The point is that among these commits there are other commits! And that's exactly what I want.

Ex:

commit 1a1a1a
Author: Gabriel Hardoim

     Commit 1A

commit 2b2b2b
Author: Gabriel Hardoim

     Commit 2B      // Esse commit me interessa

commit 3c3c3c
Author: Gabriel Hardoim

     Commit 3C      // Esse também

commit 4d4d4d
Author: Gabriel Hardoim

     Commit 4D

With this in mind, how can I make a for each between the first and last commit? Does git have any commands that can help me with this?

    
asked by anonymous 24.08.2018 / 18:26

1 answer

2

Use .. between commits:

git diff 1a1a1a..4d4d4d

Or :

git diff 1a1a1a^..4d4d4d

If you want to include the initial commit differences 1a1a1a .

Without .. , you only get the differences between only both commits and not all commits between them.

    
24.08.2018 / 21:36