Skip to content

Instantly share code, notes, and snippets.

@johnnytomcat
Last active October 4, 2018 15:21
Show Gist options
  • Save johnnytomcat/2e1127d3fd4c4691c0319bd1fbc7bd96 to your computer and use it in GitHub Desktop.
Save johnnytomcat/2e1127d3fd4c4691c0319bd1fbc7bd96 to your computer and use it in GitHub Desktop.
Script to remove local branches that no longer exist in origin.
for branch in $(git branch -vv | grep 'origin/.*: gone]' ) ; do git branch -D $branch ; done ;
@johnnytomcat
Copy link
Author

Run

project_directory$ bash git-clean-branches

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment