rodrigosantosbr

Get a Git diff of the previous commit

Jan 29th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
git diff HEAD^ HEAD

(HEAD^ means the previous version of head; leaving off the second HEAD would show any uncommitted changes lying around as well.)

To limit to a particular file, in this case "midbucket.view.inc" in the directory from which we run the command:

git diff HEAD^ HEAD -- midbucket.view.inc
Add Comment
Please, Sign In to add comment