How to delete a branch in bitbucket with mercurial hg?
Solution 1
Have you tried closing it? From hg help branch
:
Use "hg commit --close-branch" to mark this branch as closed.
Solution 2
Closing doesn't exactly delete a branch (remove all trace).
If you want to delete it, you need to hg strip
it.
- In Bitbucket, find the revision where the branch was created, and go to
Settings > Strip changesets > <Enter "Revision to strip">
. - Confirm the deletion of all the revisions attached to the revision you entered, then delete.
NOTE: This approach may not be so straight forward if you have merged. This approach is more for "I have created a branch incorrectly, I want to delete it, and recreate it again using the same branch name."
Solution 3
Using hg workbench, I lookup up the commit that started the new branch, right clicked and selected ## Copy Hash
.
Then I enabled the strip extension by adding the following to my mercurial.ini (located at %USERPROFILE%\mercurial.ini
)
[extensions]
strip =
Finally I executed the strip command using the hash from my clipboard to remove the local branch:
hg strip 36012047aee7c08cdc4ede51293392c106a3d0b7
Related videos on Youtube
Comments
-
Jurudocs about 2 years
I opened a second branch (branch2) locally in hg and pushed it to bitbucket. After that i merged the two branches locally and pushed it again...I have branch2 still living on bitbucket. How do i delete branch2 on bitbucket?