Delete multiple remote branches in git

前端 未结 18 2495
轮回少年
轮回少年 2020-12-07 07:11

I have a team member who inadvertently pushed over 150 of his local branches to our central repo. Thankfully, they all have the same prefix. Using that prefix, is there a gi

18条回答
  •  悲哀的现实
    2020-12-07 08:04

    I tried to delete all origin/release/r1-1* remote branches, hence following command line worked nicely.

    git branch -r | awk -Forigin/ '/\/*r1-1/ {print $2}' |  xargs -I {} git push origin :{}
    

提交回复
热议问题