Created
October 28, 2022 14:28
-
-
Save sachsgit/bd4792d2650281bc0af21b9edddd7411 to your computer and use it in GitHub Desktop.
Git Bash Shell Script to Remove Stale/Merged Branches
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
#!/bin/sh | |
# https://stackoverflow.com/questions/7726949/remove-local-branches-no-longer-on-remote | |
git branch --merged >/tmp/merged-branches && vi /tmp/merged-branches && xargs git branch -d </tmp/merged-branches | |
rm /tmp/merged-branches |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment