Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git diff two sequential commits shortcut?

Tags:

git

I'd like to define a shortcut "git diffn" with this behavior:

git diffn := git diff HEAD HEAD~1
git diffn 1 := git diff HEAD~1 HEAD~2
git diffn 2 := git diff HEAD~2 HEAD~3
...

First one is no problem, but I don't know to to make the rest.

like image 996
abo-abo Avatar asked Dec 16 '22 09:12

abo-abo


1 Answers

What about:

git show - shows the last commit

git show HEAD~1 - shows the last but one commit

git show <COMMIT SHA> - shows you any commit

git whatchanged - shows you which files changed against the git log

like image 59
user1158559 Avatar answered Dec 27 '22 15:12

user1158559