Skip to content

Instantly share code, notes, and snippets.

@pketh
Created September 28, 2015 19:42
Show Gist options
  • Save pketh/6a7f581b98d5b6e52dc3 to your computer and use it in GitHub Desktop.
Save pketh/6a7f581b98d5b6e52dc3 to your computer and use it in GitHub Desktop.
List my recent git branches
# add this line to your .bash-profile (.bashrc should also work)
# call this in a repo folder with `git-recent`
alias git-recent="git for-each-ref --count=5 --sort=-committerdate refs/heads/ --format='🌺 %(refname:short)'"
@dpatti
Copy link

dpatti commented Jan 23, 2016

You can also add this as an alias in .gitconfig like:

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

(I had to delete the unicode character because GitHub doesn't allow it in a comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment