Skip to content

Instantly share code, notes, and snippets.

@andrewmriley
andrewmriley / git-branches-by-commit-date.sh
Last active April 21, 2016 13:19 — forked from jasonrudolph/git-branches-by-commit-date.sh
List remote Git branches on origin and the last commit date/email for each branch. Sort by most recent commit date.
#!/bin/sh
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep origin | grep -v HEAD`;do echo -e `git show --format="%ci %cr %aE" $branch | head -n 1` \\t$branch; done | sort -r