Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding Meld 3 way merge with Git [duplicate]

My boss set up our new Git repository, one on our Windows server and one on our Linux Server.

I was asked to resolve our conflicts so I chose to use Meld.

When I run the first file it opens 3 windows;

  • shipping.php.local.####,
  • shipping.php
  • shipping.remote.####

I have read the docs and help but I'm having trouble understanding. From what I can see, the shipping.remote has the changes I made to the files on the Linux box that I want to keep. shipping.local are the files from the Windows server and the shipping.php is the file that will result from the merge.

So if I just take the code from the shipping.remote, move it to the middle file(shipping.php) and save it, I will have the updated file I want on the Git repository on the Linux box?

I hope I'm explaining correctly, I just don't want to mess something up.

like image 358
Naterade Avatar asked Aug 29 '12 14:08

Naterade


People also ask

How does git three-way merge work?

3-way merges use a dedicated commit to tie together the two histories. The nomenclature comes from the fact that Git uses three commits to generate the merge commit: the two branch tips and their common ancestor.

How do you resolve a merge conflict with meld?

In case of a merge conflict, you need to manually edit the conflicting files, comparing the changes you and your colleague made and deciding on the final version of the files, and then run git commit to finalize the merge commit.

What is the difference between fast forward merge and 3-way merge of branches?

It is called so because, in the 3-way merge, Git uses three commits to generate the merge commit; two branch tips and their common ancestor. Typically, the fast forward merge is used by developers for small features or bug fixes while the 3-way merge is reserved for integrating longer-running features.

How do I resolve merge conflict in Mergetool?

Use git mergetool to run one of several merge utilities to resolve merge conflicts. It is typically run after git merge. If one or more <file> parameters are given, the merge tool program will be run to resolve differences on each file (skipping those without conflicts).


1 Answers

You understand correctly what are the files you see. But if you merge in a way you described (incorporate changes from remote to base), you will loose changes from local. In fact, you have to merge both local and remote into base. You could use Changes | Merge all non-conflicting and then resolve each conflict by hand.

like image 53
Greg Avatar answered Oct 25 '22 09:10

Greg