Created
April 9, 2013 21:59
-
-
Save bjorg/5349797 to your computer and use it in GitHub Desktop.
Script for showing all Git branches and what remote branch they are mapped to (if any).
This file contains hidden or 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
| #!/bin/sh | |
| git for-each-ref --format='%(refname:short)' refs/heads/* | while read b | |
| do if r=$(git config --get branch.$b.remote) | |
| then | |
| m=$(git config --get branch.$b.merge) | |
| echo "$b -> $r/${m##*/}" | |
| else | |
| echo "$b -> MISSING REMOTE" | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment