git - Shorthand for getting the diff from the last N commits? -
i know can do:
git diff head^..head but there shorthand that's easier remember, like:
git diff foo n where n can number of commits cumulative diff of?
from specifying revisions of git rev-parse man page:
a suffix
~<n>revision parameter means commit object<n>th generation grand-parent of named commit object, following first parent.
i.e.rev~3equivalentrev^^^equivalentrev^1^1^1.
consider examples in git diff man page:
git diff head^..head git diff head^.. git diff head^ head are equivalent forms (thanks chrisk head^.. form, mentioned in comments).
(they not equivalent git diff head^, mark longair comments, since diff working directory, not last commit)
so:
git diff head~15 # diff working tree 15th previous commit git diff head~15 head # diff last commit 15th previous commit should need (as khmarbaise mentions in comment).
Comments
Post a Comment