Skip to content

Instantly share code, notes, and snippets.

@ganey
Created August 10, 2017 16:13
Show Gist options
  • Save ganey/5f3700f791a7667b0333ddb0f1bcc273 to your computer and use it in GitHub Desktop.
Save ganey/5f3700f791a7667b0333ddb0f1bcc273 to your computer and use it in GitHub Desktop.
Git prune local branches not on remote, excluding 'master, staging , develop' - works on windows
#!/bin/sh
git branch --merged | grep -v "\*" | grep -v "master" | grep -v "develop" | grep -v "staging" | xargs -n 1 git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment