Delete multiple remote branches in git

前端 未结 18 2468
轮回少年
轮回少年 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:01

    Warning: This will delete all remote branches. Use with caution.

    I think my way deleting remote branches is the best.

    git branch -r | grep -v master | sed 's/origin\//:/'| xargs git push

    Warning: This will delete all remote branches. Use with caution.

提交回复
热议问题