LoginSignup
0
0

More than 3 years have passed since last update.

Git developブランチにマージされたlocalブランチを削除する

Posted at

コマンド

$ git branch -r --merged develop | grep "ブランチ名" | cut -d "/" -f2- | xargs -t -I{} git push --delete origin {}
  • git branch -r --merged develop

    • developブランチにマージされたリモートブランチ表示
  • | grep "ブランチ名"

    • 特定のブランチ名で検索
  • | cut -d "/" -f2-

    • 最初に出現するスラッシュまでの文字列を除外
  • | xargs -t -I{} git push --delete origin {}

    • 洗い出したブランチを削除する
0
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
0
0