LoginSignup
1
0

More than 5 years have passed since last update.

ローカルの複数ブランチを一括で削除するときのコツ

Posted at
git branch | grep [文字列] |  while read branch ; do git branch -d ${branch} ; done ;  

とするので、以下の様にブランチ名に一貫性をもたせる。

br2011
br2001
br2020
master

実行するときは

$ git branch | grep br | while read branch ; do git branch -d ${branch} ; done ;  

最初 |grep br2011 br2001 | と書いていたけど、2つ目は「ファイル名」らしいので注意。

参考

1
0
1

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
1
0