How to delete all remote git branches which have already been integrated?

后端 未结 6 1956
暖寄归人
暖寄归人 2021-01-30 09:21

At work we are using topic branches which are integrated into a few (3) master branches at some point. Now I\'d like to delete all topic branches from my remote reposit

6条回答
  •  北海茫月
    2021-01-30 09:33

    You can do this in one go with

    git branch --merged master | grep -v master | xargs -n 1 git push --delete origin
    

    Dump that in a script called 'clean' if you find you're doing this often.

提交回复
热议问题