Skip to content

Instantly share code, notes, and snippets.

@melizeche
Last active February 5, 2016 00:16
Show Gist options
  • Save melizeche/2189a05a90f4dfe629fe to your computer and use it in GitHub Desktop.
Save melizeche/2189a05a90f4dfe629fe to your computer and use it in GitHub Desktop.
Remove all git branches except 'master'
git for-each-ref --format '%(refname:short)' | grep -v master | sed 's/^origin\///' | sed 's/^/ git push origin :/' | bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment