Skip to content

Instantly share code, notes, and snippets.

@tcg
Created June 7, 2017 18:42
Show Gist options
  • Save tcg/2e098ff2d10586bb767ce0d0ddb4a413 to your computer and use it in GitHub Desktop.
Save tcg/2e098ff2d10586bb767ce0d0ddb4a413 to your computer and use it in GitHub Desktop.
List Git branches by date; Helpful if you jump around a lot.
# List Git branches in order of most-recently-updated.
alias gitbranchesbydate="git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:iso8601) %09 %(refname) %09 %(authorname)' | sed -e 's-refs/heads/--'"
# Output looks like:
# 2014-06-06 12:58:53 -0500 tcg/donate_language_updates Tommy George
# 2014-06-06 10:28:04 -0500 integration Brad
# 2014-06-05 16:13:30 -0500 super_dev_branch Chris
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment