在命令行上合并 Mercurial 冲突?
好的,我已通过 SSH 连接到服务器,我运行命令:
hg合并
我现在看到一个分为 3 个部分的屏幕。在底部,它们被标记为:
file
file~other.Dcyqtz
file~base.N64J4dp
显然它希望我解决冲突。看起来第一个是我的本地更改,其他是我刚刚拉出并试图合并的更改。基础是文件在分割之前的样子。
因此,对于存在冲突的每个部分,我认为我应该选择保留这三个部分中的哪一个。
我该怎么做?
我处于命令外壳中,因此无法单击任何内容。我只能在 3 个部分中的第一个部分上下移动光标,我不知道如何将光标移动到其他 2 个部分。
我不知道如何指定,这里使用我的,那里使用其他的,那里使用基地。
我也不知道怎么说,我放弃了,退出了。
所以目前我陷入困境。
OK I am connected to a server via SSH, I run the command:
hg merge
I am now taken to a screen that is split into 3 sections. On the bottom they are labeled as:
file
file~other.Dcyqtz
file~base.N64J4dp
Obviously it wants me to resolve conflicts. It looks like the first one is my local changes, other is the changes I just pulled and am trying to merge with. And base is what the file looked like before splitting.
So for every part where there is a conflict I supposed I am to pick which of the 3 to keep.
How do I do this?
I am in a command shell so I can not click on anything. I can only move my cursor up and down in the first of the 3, I do not know how to get my cursor to the other 2 sections.
I do no know know how to specify, use mine here, use other there, and use base over there.
Also I do not know how to say, I give up and exit.
So currently I am stuck.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
正如 Cesar 提到的,您需要一个合并工具。如果您熟悉 vim,我建议您使用 vimDiff。
另外,不用担心,您没有丢失任何数据或做错任何事情。
只需设置一些合并工具,使用
hg update -C
从干净的状态开始。继续进行hg merge
。As Cesar mentioned, you need a merge tool. If you are familiar with vim, I suggest vimDiff.
Also, don't worry, you didn't lose any data or did anything wrong.
Just setup some merge tool, use
hg update -C
to start from clean slate. Proceed withhg merge
.也许您需要的是合并工具
更新:
当然您可以想要使用 SSH X11转发
Maybe what you need is a merge tool
UPDATE:
Of course you may want to use SSH with X11 forwarding
我在使用 KUbuntu 11.04 时遇到了完全相同的情况。
(我曾经使用过 emacs,而不是 vim。所以看着那些 3split 控制台对我来说也很惊讶。)
现在我做了
hg rollback
并安装了合并 gui 工具 KDiff3 .然后研究“如何在 hg merge 中激活这个 gui 合并工具?”
告诉我该怎么做...
/usr/bin/kdiff3
所以我添加到
~/.profile
然后一切都完成了。
在新的 shell 中
hg merge
弹出了 GUI 合并工具 KDiff3,请参阅 handbook-pdf http://kdiff3.sourceforge.net/doc/kdiff3_de.pdfI am stumbling over exact same situation, usung KUbuntu 11.04.
(And me once was used emacs, not vim. So looking at those 3split console was surprising for me, too.)
Now I did
hg rollback
and installed me merger gui tool KDiff3 .Then looking into "howto get this gui merger tool activated within the hg merge?"
Tells me what to do...
/usr/bin/kdiff3
So I added to
~/.profile
Then all was done.
In a new shell
hg merge
popped me up with the gui merger tool KDiff3, see handbook-pdf http://kdiff3.sourceforge.net/doc/kdiff3_de.pdf