LoginSignup
8
7

More than 5 years have passed since last update.

[Git]マージ済みのリモートブランチを一括削除

Posted at

何番煎じだっていうネタを自分用にメモ。
毎回組み立ててるので、エイリアスに登録すればいいんだけど
いまいち腰が重い。

git checkout master
git branch -r --merged | grep -v master | sed -e "s|origin/||" | xargs git push --delete origin 
git branch -r --merged #現在いるブランチにマージ済みのリモートブランチを表示
grep -v master  #masterを含む行を除外(場合によってはdevelopも追加する
sed -d "s|origin/||"  #origin/ を置換
 git push --delete origin foo    #fooブランチを削除
8
7
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
8
7