LoginSignup
1
2

More than 5 years have passed since last update.

gitのリモートブランチをmaster以外全削除する方法

Last updated at Posted at 2017-08-14

One lineでoriginにあるmaster以外のブランチの削除をした時のメモです。

もっと完結に書く方法知ってる方いらっしゃれば、ツッコミお願いします。。。。
git branch -a | grep remotes/origin | grep -v master | sed -e s/^.*remotes\\/origin\\///g | xargs git push -d origin

@yoichi22 さんからアドバイスいただきました!
ありがとうございます!
git branch -r | grep origin | grep -v master | sed -e s/^.*origin\\///g | xargs git push -d origin

1
2
2

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
2