I find myself typing this pretty often, like when I made some change, committed it, and then either need to look up something I did there to figure out what to do next, or make sure I didn't add anything unintended to the commit before pushing it to a remote.
Admittedly, diff HEAD^ HEAD is fast enough to type (git diTABHTAB←^ HTAB), but it still feels like there should be a better way.
How do I easiest see all changes made in the last commit?
Try git show. Without other options, it shows a diff of the latest commit.
git show $something shows the content of $something in a user-friendly way. When $something refers to a file, git show will display the file's content. When it refers to a commit, Git shows the commit (author, date, commit log and diff). git show without more arguments is equivalent to git show HEAD.
I also found in this post that @ is a shortcut for HEAD. So
git diff @^ @
or
git show @
is also an option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With