user116032 user116032 - 6 days ago 6
Git Question

Can you git diff without knowing the previous commit?

git diff id_old id_newer


Is the standard simple use of git diff. Can you give git diff the new commit id alone and ask it to report the diff between it and the previous file changing commit without knowing it?
Something like:

git diff id_newer --fromlastchange (vs --fromlastcommit)

Answer

You should try to do

git diff id_newer^!

Which should give you the changes of the id_newer commit.