Created
March 5, 2020 07:25
-
-
Save ahmad-reza619/7368985f5407578dc1f0a744bb9bb956 to your computer and use it in GitHub Desktop.
Delete local branch that is not exist on remote
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
The command for this is | |
`git fetch --prune` | |
and then | |
`git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d` | |
original: https://stackoverflow.com/questions/13064613/how-to-prune-local-tracking-branches-that-do-not-exist-on-remote-anymore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment