Git recent

February 11 2018

I’ve wrote a couple posts on git over the years so I thought I’d share another snippet sitting in my .gitconfig which I find particularly useful when working across multiple branches, as I tend to forget where I last left off. It’s called git recent and lists the last 10 branches I’ve committed to.

ยง git recent
dn-picture-configuration
master
production
production-dn-avatar-fit
...

And finally the entry in my .gitconfig.

[alias]
  ...
  recent = "for-each-ref --sort=-committerdate --count=10 --format='%(refname:short)' refs/heads/"