Remove remote merged branches
You can remove all remote branches that have been merged to master in one line.
git branch -r --merged master | ack -v master | sed -e 's/\// :/' | xargs -n2 git push
Written by Enrique Vidal
Related protips
2 Responses
The sed expression should probably not be global, it breaks for branch names with slashes in them.
sed -e 's/\// :/'
over 1 year ago
·
Oh nice catch, I'll edit the protip removing the global bit, thanks.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#