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

后端 未结 6 1960
暖寄归人
暖寄归人 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条回答
  •  -上瘾入骨i
    2021-01-30 09:41

    Just for Powershell and windows users.

        git branch -r --merged  | findstr /v "origin/master" | %{git push origin --delete $_.Trim().Substring(7)}
    

提交回复
热议问题