Skip to content

Instantly share code, notes, and snippets.

@stefanotorresi
Forked from jasonrudolph/git-branches-by-commit-date.sh
Last active December 16, 2015 05:49
Show Gist options
  • Save stefanotorresi/5386928 to your computer and use it in GitHub Desktop.
Save stefanotorresi/5386928 to your computer and use it in GitHub Desktop.
show a list with info about the last commit of each branch.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ct %cr | %h %s" $branch | head -n 1` \| $branch; done | sort -r
# Example output (resulting from running command on https://github.com/stefanotorresi/zf2)
1365796107 3 days ago | c82da00 Merge branch 'hotfix/4216' into develop | upstream/develop
1365796093 3 days ago | 9a976bc Merge branch 'hotfix/4216' | upstream/master
1365796093 3 days ago | 9a976bc Merge branch 'hotfix/4216' | origin/master
1365087807 11 days ago | ac67304 fix Zend\Validator\File\Wordcount message key and typo | origin/hotfix/2536
1359499936 3 months ago | c743838 [2.0.7] update README, CHANGELOG, and Zend\Version | upstream/releases/2.0
1354308796 5 months ago | b031127 Merge branch 'hotfix/3117' into develop Forward port #3117 | origin/develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment