Last active
October 4, 2018 15:21
-
-
Save johnnytomcat/2e1127d3fd4c4691c0319bd1fbc7bd96 to your computer and use it in GitHub Desktop.
Script to remove local branches that no longer exist in origin.
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
for branch in $(git branch -vv | grep 'origin/.*: gone]' ) ; do git branch -D $branch ; done ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run
project_directory$ bash git-clean-branches