Skip to content

Instantly share code, notes, and snippets.

@adamthede
Created January 30, 2022 20:31
Show Gist options
  • Save adamthede/29002af1f877a081582f58f8ee534617 to your computer and use it in GitHub Desktop.
Save adamthede/29002af1f877a081582f58f8ee534617 to your computer and use it in GitHub Desktop.
List of Git branches, sorted by most recent first
git for-each-ref --sort=-committerdate refs/heads/
# Or using git branch (since version 2.7.0)
git branch --sort=-committerdate # DESC
git branch --sort=committerdate # ASC
OR
git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment