Created
February 20, 2023 14:12
-
-
Save aboritskiy/fe27fc16929ef76e20dead2df8fb9a8d to your computer and use it in GitHub Desktop.
Remove merged remote 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/bash | |
set -eu | |
git fetch -ap | |
git branch -r --merged origin/master | grep -v master | grep -v dev | grep -v HEAD | sed 's/^ origin\///' | xargs git push --delete origin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment