Skip to content

Instantly share code, notes, and snippets.

@naosim
Created May 28, 2014 02:46
Show Gist options
  • Save naosim/b27a7e77d7dcc8c25c51 to your computer and use it in GitHub Desktop.
Save naosim/b27a7e77d7dcc8c25c51 to your computer and use it in GitHub Desktop.

ブランチを一括で消す方法

"sp1" を含むブランチをすべて削除
git branch | grep sp1 | xargs -I % git branch -d %

スプリント毎に
sp1/feature/hoge
sp1/feature/foo
sp1/hotfix/bar
みたいなブランチを切ってそれらを全部消したいときに便利です。

@m-doi
Copy link

m-doi commented Nov 9, 2016

マージ済みのやつを全部消したいときとかはこうやってます

git branch --merged | grep -v "develop" | grep -v "master" | xargs git branch -d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment