Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merging Mercurial conflicts on command line?

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:

  1. file

  2. file~other.Dcyqtz

  3. 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.

like image 999
JD Isaacks Avatar asked Oct 31 '11 20:10

JD Isaacks


2 Answers

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 with hg merge.

like image 107
bbaja42 Avatar answered Sep 18 '22 07:09

bbaja42


Maybe what you need is a merge tool

UPDATE:

Of course you may want to use SSH with X11 forwarding

like image 43
César Avatar answered Sep 22 '22 07:09

César