1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Tips】Gitで複数のブランチを一括削除(一致・除外)

Last updated at Posted at 2020-05-07
bash
# 対象ブランチのみ強制削除
$ git branch | grep ${target_word} | xargs git branch -D

# 対象ブランチ以外を強制削除
$ git branch | grep -v ${target_word} | xargs git branch -D
1
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?