Last active
November 20, 2018 17:14
-
-
Save jeffreyschultz/48e0352c3c668408f63de8314a1f8198 to your computer and use it in GitHub Desktop.
Prunes git branches that have been merged
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
#!/usr/bin/env bash | |
git branch --merged | egrep -v "(^\*|master|green|blue)" | xargs git branch -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git fetch -p upstream && git branch -r --merged upstream/master | grep -Ev '(master|green|blue)' | grep "upstream/" | cut -d "/" -f 2- | xargs -n 20 git push --delete upstream