Last active
July 23, 2024 21:52
-
-
Save abritinthebay/cacc0745f18d3eec4ef7eda3f6c1e09e to your computer and use it in GitHub Desktop.
How to delete merged git remote branches (git-flow safe)
This file contains hidden or 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
git fetch --prune | | |
git branch -r --merged | | |
grep origin | | |
grep -v '>' | | |
grep -v master | | |
grep -v develop | | |
sed -E "s|^ *origin/||g" | | |
xargs git push origin --delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment