Ayende @ Rahien

It's a girl

Doing merges in git

One of the things that some people fear in a distributed source control is that they might run into conflicts all the time.

My experience has shown that this isn’t the case, but even when it is, there isn’t really anything really scary about that.

Here is an example of a merge conflict in Git:

image

Double click the conflicting file, and you get the standard diff dialog. You can then resolve the conflict, and then you are done.

Tags:

Posted By: Ayende Rahien

Published at

Originally posted at

Comments

tobi
10/23/2010 10:50 AM by
tobi

Did you notice that merging with git requires less work than with svn? This is what everyone says at least.

Gonzalo
10/23/2010 04:07 PM by
Gonzalo

Merging with any of the major implementations of DVCS is easier and requires much less work than SVN or any other centralized VCS because the system inherently has more information at hand to perform the merge.

JD
10/23/2010 04:08 PM by
JD

I'm surprised to see that dialog...you strike me a "git bash" type of guy. ;)

Ayende Rahien
10/23/2010 05:49 PM by
Ayende Rahien

Tobi,

Yes, git is keeping much more data, so it can handle it better

Josh
10/24/2010 06:46 PM by
Josh

Tobi, I too see much less manual merging with git than svn/cvs. Funny, yhe only 2 projects where i've had to do a manual merge are FluentMigrator (my fault) and RavenDB (which was probably also my fault).

Jimmy Chan
10/25/2010 12:30 AM by
Jimmy Chan

Ayende,

Are you using tortoise for git?

Jim
10/25/2010 10:36 AM by
Jim

What sort of data does git store that makes it much better at merging than SVN?

Ayende Rahien
10/25/2010 03:17 PM by
Ayende Rahien

Jim,

Basically, it records each individual change, so it is able to do merge on each change independently, while SVN need to do merge between the final results.

Gian Maria
10/26/2010 09:06 AM by
Gian Maria

It would be interesting having more deep comparison between merging in DVCS and standard centralized system like svn. Is true indeed that git stores more information for merges than SVN, but usually I do merge in svn with no great pain.

Tortoise for svn show changes files, conflicted files, and I can open the diff from the tortoise windows, resolve the conflicts, check the merge and commit, basically I see the same windows you show with tortoise git.

Clearly svn only compare the actual state of the source and destination folder, but usually is enough for me.

Alk.

Comments have been closed on this topic.