Created
August 12, 2015 10:57
-
-
Save BYK/66dfd985491b483bd140 to your computer and use it in GitHub Desktop.
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
import itertools | |
import operator | |
get_branches = lambda: [branch[1:].strip() for branch in $(git branch --list).split('\n') if branch] | |
get_remotes = lambda: dict((k, set(v[1] for v in group)) for k, group in itertools.groupby(branch.split('->')[0].split('/') for branch in $(git branch -r).split(), operator.itemgetter(0)) if k) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment