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
[alias] | |
gone = "!f() { git fetch --all --prune; git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D; }; f" | |
merged = "!f() { git branch --merged | egrep -v '(^\\*|master|main|dev)' | xargs git branch -D; }; f" | |
delete = "!f() { for branch in \"$@\"; do git branch -D \"$branch\" && git push origin --delete \"$branch\"; done; }; f" | |
# usage | |
# git gone => delete "gone" branches locally and remotely | |
# git merged => delete "merged: branches locally and remotely | |
# git delete branche-a branche-b branche-c => delete a, b and c branches locally and remotely |