Skip to content

Instantly share code, notes, and snippets.

@nashirox
Last active February 8, 2018 13:44
Show Gist options
  • Save nashirox/9a506e38f13e46ccbebed7f8dfa05486 to your computer and use it in GitHub Desktop.
Save nashirox/9a506e38f13e46ccbebed7f8dfa05486 to your computer and use it in GitHub Desktop.
# ローカルのmasterブランチ以外削除
$ git branch | grep -v 'master' | grep -v '*' | xargs git branch -D
# リモートのmasterブランチ以外全削除
$ git branch -r | grep origin | grep -v master | sed -e s/^.*origin\\///g | xargs git push -d origin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment