Skip to content

Instantly share code, notes, and snippets.

@cerkut
Forked from jasonrudolph/git-branches-by-commit-date.sh
Last active September 12, 2018 21:14
Show Gist options
  • Save cerkut/2cbb7e2955d3d543bc9dc04560aff897 to your computer and use it in GitHub Desktop.
Save cerkut/2cbb7e2955d3d543bc9dc04560aff897 to your computer and use it in GitHub Desktop.
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment