0
0

More than 3 years have passed since last update.

Gitのmasterブランチ意外、全てのブランチを一括削除する

Posted at

タイトルの通りに、master ブランチ意外全て削除するのは以下のコマンドです。
'master'の代わりに他のブランチ名を変えることもできます。

ターミナル
git branch | grep -v 'master' | xargs git branch -D

長くて覚えづらいので、aliasを作成しました。

~/.zshrc
alias gbr="git branch | grep -v 'master' | xargs git branch -D"
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0