I like to commit often, and then continuously amend my last commit.

Here's a little snippet to show only the diff for the last commit:

git show `git log | head | awk 'FNR == 1 {print $2}'`


Scans your harddrive looking for bitcoin private keys.


Just joking :)

"git show" with a commit hash shows the diff.

The rest of the command is just to get the lat commit hash from "git log".


@jcbrand Git show by default shows the last commit, right?

@jcbrand Also you can get the last commit with HEAD, the one before is HEAD~1, HEAD~2...


I've only ever used it with a hash.

Makes perfect sense now that you mention it.

Sign in to participate in the conversation
unidentified instance

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!