Last active
January 23, 2022 00:30
-
-
Save nibble-4bits/596abda664cfc69f37482faec3c7d2eb to your computer and use it in GitHub Desktop.
A bash script to delete all branches merged to the branch passed as first argument
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 | |
# Delete gone remote branches | |
git remote prune origin | |
# List all local branches that were published to the remote and delete them | |
git branch -v | awk -e '/gone/ { print $1 }' | xargs git branch -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment