Lesser used git commands

July 2017

Most of these don't see much action day to day, but they're useful when they're useful.

# See a list of recent commits
git log --stat --pretty=short --graph

# Disregard uncommited changes to a file
git checkout -- /PATH/TO/FILE

# Checkout a specific past commit as a new branch

# Amend a commit message before pushing
git commit --amend

# Add staged filed to the last commit (useful for assets)
git commit --amend -C HEAD

# List remote git branches
git branch -a

# See changes to files you've already committed 
git diff --cached

Ever wish you got more email?

Neither do I. You're busy, and so is your inbox. I'll only be in touch when I publish something new. And of course it goes without saying your email will be kept completely private.