Mercurial - 恢复合并并重试的基本过程
我们使用此过程进行合并:
cd c:\myapp
hg pull ssh://hg/myapp-1_0_1
hg merge
现在有时我们会搞乱合并,或者有时会收到错误(即:“无法合并文件 xxx - 文件正在使用”)。通常我只是删除我的 c:\myapp 存储库,从远程主存储库重新克隆并重新开始。这有效,但很痛苦。有什么更好的办法呢?
我已经阅读过有关使用 hg update -C
的信息,但我不清楚该过程。因此,您需要执行 hg update -C
,这将删除合并的文件,但保留下拉的变更集,然后再次发出 hg merge
命令然后再试一次?
更新关于相关问题:hg update -C
仍然保留使用 hg pull
拉下的存储库中的变更集 - 如何摆脱这些变更集?
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 do hg update -C
, this would delete the merged files but keep the changesets that were pulled down, and then you'd issue the hg 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 with hg pull
- how can you get rid of those?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
hg update -C
非常完美。为什么要删除拉取的变更集?因为更新命令更新到了拉取的更改的头部?如果这是您提取的更改的问题,请运行hg update -C
并且不关心提取的更改,您可能会提取它们无论如何,在某个时候再次出现。更新后继续您的工作或再次尝试合并。但是,如果您确实想删除拉取的更改,请使用 strip 命令。
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, runhg 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.
请参阅这篇文章如何放弃 hg 合并?
See this post How to abandon a hg merge?