Created
May 28, 2020 08:05
-
-
Save Zenahr/22f5d376346c20d86642d772f0afe98e to your computer and use it in GitHub Desktop.
[Git] delete local branches which do not have an equivalent on remote anymore (i.e. after merging)
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 branch -vv (Check for the "gone" keyword) | |
git branch -d [branch-name] | |
voila, local garbage collection done. | |
This is the only safe and simple way to do this just using high-level git commands without scripting complicated and perhaps hazardous regex-based commands |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment