Delete branches in Bitbucket

前端 未结 12 1603
执念已碎
执念已碎 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:42

    If the branches are only local, you can use -d if the branch has been merged, like

    git branch -d branch-name
    

    If the branch contains code you never plan on merging, use -D instead.

    If the branch is in the upstream repo (on Bitbucket) you can remove the remote reference by

    git push origin :branch-name
    

    Also, if you're on the Bitbucket website, you can remove branches you've pushed by going to the Feature branches tab under Commits on the site. There you'll find an ellipsis icon. Click that, then choose Delete branch. Just be sure you want to drop all the changes there!

提交回复
热议问题