Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove accidental branch in TortoiseHg?

Tags:

(I am a relative newcomer to TortoiseHg, so bear with me :-) I use TortoiseHg on two machines to talk to my remote source repository. I made changes on one machine, committed them, and attempted to push them to the remote repository BUT I forgot to first do a pull to get the latest code first. The push gave me a few lines of output, suggesting I may have forgotten to pull first (true!) and mentioned something like "abort: push creates new remote branches...".

So I did a pull, which added several nodes to the head of my graph in the repository explorer. The problem is that the push I tried to do is now showing as a branch in the repository explorer. Looking from the server side (codeplex), it shows no sign of my attempted push, indicating this accidental branch is still local on my machine.

How could I remove this accidental branch? I tried selecting that node in the graph then doing "revert" but it did not seem to do anything. I am wondering if it would be simplest to just discard my directory tree on my local machine and do a completely new, clean pull from the server...?

like image 688
Michael Sorens Avatar asked Jun 03 '10 04:06

Michael Sorens


People also ask

How do I close a branch on TortoiseHg?

when you are on your NewFeature branch (no need to have anything to commit - or you do it with your final merge) click "Branch: NewFeature" (it's at the top in bold) select "Close current branch".

How do I delete a branch in Mercurial?

You cannot. You can close the branch to hide it from the list of active branches, but you cannot completely delete it. This happens because in mercurial and in git the "branch" term means different things. In mercurial - it is a set of changesets.


1 Answers

First make sure you have committed all your local changes. Then merge the branches by calling hg merge and commit the result.

This should bring you back to a single branch, reuniting the two heads.

like image 110
sth Avatar answered Sep 25 '22 07:09

sth