Delete branches in Bitbucket

前端 未结 12 1639
执念已碎
执念已碎 2020-12-22 16:53

I\'ve created lots of branches in one of our repositories. Those branches are for testing before it will be pulled to the master. Now I see lots of them on the list and they

12条回答
  •  渐次进展
    2020-12-22 17:45

    Try this command, it will purge all branches that have been merged to the develop branch.

    for i in `git branch -r --merged origin/develop| grep origin | grep -v '>' \
       | grep -v master | grep -v develop | sed -E "s|^ *origin/||g"`; \
    do \
       git push origin $i --delete; \
    done
    

提交回复
热议问题