Last active
March 15, 2020 11:10
-
-
Save JamieMason/7357169 to your computer and use it in GitHub Desktop.
List all remote branches, most recent first
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
With author name
for branch in `git branch -r | grep -v HEAD`; do echo -e `git show --format="%ci %an %cr" $branch | head -n 1` \\t$branch; done | sort -r
Example output.
2013-11-06 22:31:56 +0000 Jamie Mason 18 hours ago origin/refactor
2013-10-24 13:24:40 +0100 Jamie Mason 2 weeks ago origin/issue-52
2013-10-24 11:13:56 +0100 Jamie Mason 2 weeks ago origin/issue-51
2013-10-14 11:07:05 +0100 Jamie Mason 3 weeks ago origin/gh-pages
2013-09-29 20:50:54 +0100 Jamie Mason 6 weeks ago origin/develop
2013-08-10 19:01:08 +0100 Jamie Mason 3 months ago origin/jamesstout-issue-41
2013-08-10 17:16:36 +0100 Jamie Mason 3 months ago origin/jamesstout-issue-40
2013-08-10 16:01:20 +0100 Jamie Mason 3 months ago origin/master
2013-06-23 22:33:30 +0100 Jamie Mason 5 months ago origin/issue-7
2013-03-04 11:23:29 +0000 Jamie Mason 8 months ago origin/headless
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example output.
The
%ci
format is a little ugly (outputting2013-11-06 22:31:56 +0000
) but it's needed to be able to sort the results by most recent commit.