ローカルのfeature
ブランチを一括で削除したかった。
git branch -D feature/1 feature/2 ...
でやっていたがブランチの指定が面倒だったのでメモ。
git branch --list "feature/*" | xargs -n 1 git branch -D
まずbranch
コマンドで feature
ブランチをすべて取得します。
その後 xargs
コマンドでそれを取得し削除コマンドに渡します。
これで feature/*
に合致するブランチをすべて削除できます。