Created
June 7, 2017 14:50
-
-
Save jumarome/986b8f3d0d38599c6dbc81415d92387e to your computer and use it in GitHub Desktop.
Remove local branches that do not exist in remote
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
| git fetch --prune | |
| git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment