git - How do I get a list of all remote branches that I create -
the command git branch -a
produces list of on 250 branches. i'd know mine can verify they're merged production , delete remotes.
is there git command show me remote branches created? easier if branches created still in local repo, got new computer local repo lost. don't have branches locally, nor have complete reflog.
assuming branches created last commit performed (is correct case?), here small python script wrote solve problem:
#!/usr/bin/python import subprocess remotes_output = subprocess.check_output("git branch -r".split()) remotes = remotes_output.split()[2:] author_cmd = lambda b: "git log -1 --pretty=format:'%%an' %s" % b branch_name in remotes: print '%s : %s' % (branch_name, subprocess.check_output(author_cmd(branch_name).split()))
it takes names of remote branches, removes first entry mapping head , prints out authors - in sense written above.
now, copy script file , grep output in shell:
python this_script.py | grep 'your name in git'
Comments
Post a Comment