Created
June 6, 2019 13:46
-
-
Save jmsfwk/35622dfc2113e5cd74813027af0a4e35 to your computer and use it in GitHub Desktop.
Git delete merged branches
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
#!/bin/bash | |
set -ue | |
git fetch | |
git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d |
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
#!/bin/bash | |
set -ue | |
git fetch | |
git branch --remote --merged origin/master | egrep -v "(^\*|master|dev)" | cut -d"/" -f2- | xargs git push origin -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you put these somewhere on you path and make them executable you can run them with
git cleanup
andgit cleanup-remote