Skip to content

Instantly share code, notes, and snippets.

@chetbox
Last active May 12, 2020 09:10
Show Gist options
  • Save chetbox/537145e0ddab03d5829782b837ea05e1 to your computer and use it in GitHub Desktop.
Save chetbox/537145e0ddab03d5829782b837ea05e1 to your computer and use it in GitHub Desktop.
git list-branch: List local git branches, ordered by last commit
git config --global alias.branch-list "for-each-ref --sort='-committerdate' --format='%(color:dim white)%(committerdate:relative)%(color:normal)%09%(color:no-dim magenta)%(refname:short) %(color:no-dim red)%(upstream:short)' refs/heads"
git branch-list
@chetbox
Copy link
Author

chetbox commented May 12, 2020

Example output:

$ git branch-list
15 hours ago    foo origin/foo
17 hours ago    bar
2 weeks ago     baz origin/baz

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