Skip to content

Instantly share code, notes, and snippets.

@gaizka
Last active October 5, 2016 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaizka/36e164579fd590f879b508815e17e5d1 to your computer and use it in GitHub Desktop.
Save gaizka/36e164579fd590f879b508815e17e5d1 to your computer and use it in GitHub Desktop.
A couple of git aliases
[alias]
current-branch = rev-parse --abbrev-ref HEAD
latestbranches = for-each-ref --count=15 --sort=-committerdate --format='%(committerdate:relative) %(refname:short)'
latestnonmasterbranch = !git for-each-ref --count=15 --sort=-committerdate --format='%(refname:short)' | grep -Ev 'origin|stash|master' | grep -v `git current-branch` | head -n 1
gotolast = !git co `git latestnonmasterbranch`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment