Created
November 27, 2017 16:19
-
-
Save alfchee/62d2cbe67e8e018f0d98aeaf33e29b37 to your computer and use it in GitHub Desktop.
This simple script will prune the removed branches on remote, list the branches that has a state of "gone" and then remove them
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
git fetch -p && git branch -vv | awk '/: 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
The original discussion can be found in https://stackoverflow.com/questions/7726949/remove-local-branches-no-longer-on-remote