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

后端 未结 6 1953
暖寄归人
暖寄归人 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:26

    If you want to delete remote branches from origin repository:

    git branch -r --merged develop | egrep -iv '(master|develop)' | sed 's/origin\///g' | xargs -n 1 git push --delete origin
    

提交回复
热议问题