Mercurial - basic process to revert a merge and try again
Solution 1
hg update -C
is just perfect. Why would you want to get rid of the pulled changesets? Because the update command updates to the head of the pulled changes? If this is your problem with the pulled changes, run hg update -C <revision-of-your-local-head>
and don't care about the pulled changes, probably you'll pull them again at some point anyway. After the update proceed your work or try the merge again.
However, if your really want to get rid of pulled changes, use the strip command.
Solution 2
See this post How to abandon a hg merge?
![Marcus Leon](https://i.stack.imgur.com/Xk75m.jpg?s=256&g=1)
Marcus Leon
Director Clearing Technology, Intercontinental Exchange. Develop the clearing systems that power ICE/NYSE's derivatives markets.
Updated on June 04, 2022Comments
-
Marcus Leon about 2 years
We merge using this process:
cd c:\myapp hg pull ssh://hg/myapp-1_0_1 hg merge
Now sometimes we mess up the merge or sometimes we get an error (ie: "can't merge file xxx - file in use"). Usually I just delete my c:\myapp repo, re-clone from the remote master repo and start over. This works but it's a pain. What is a better way?
I've read about using
hg update -C
but I'm not clear on the process. So you'd dohg update -C
, this would delete the merged files but keep the changesets that were pulled down, and then you'd issue thehg merge
command again and try again?
Update Regarding the related question:
hg update -C
still keeps the changesets in the repo which were pulled down withhg pull
- how can you get rid of those?-
R. Martinho Fernandes over 13 yearsThe
C
inhg update -C
is not a placeholder for a changeset. It's just ye old capital third letter of the alphabet. -
R. Martinho Fernandes over 13 yearspossible duplicate of How to abandon a hg merge?
-
-
R. Martinho Fernandes over 13 yearsMy memory is not at its best today... When I saw this question I went looking through my own asked questions, because I knew I had asked it before. Apparently I had answered it. I think I need more coffee...