What's the difference between SVN and Git for merging?

git, svn

Solution

That is called on merge with conflict, and no VCS will ever solve that for you. You will have to manually solve the merge yourself.

As mentioned in Why merging in git is better than SVN, the actual difference is in the history recording of commits:

- linear for SVN

- DAG (Directed Acyclic Graph) for Git

That allows Git to remember what has already merged, reducing considerably the conflicts occurrences.

So, when it comes time to do merge from 5b over to the (a) branch, we can use information in the DAG to know that 3b and 2b are already done

So it is the merge workflow that Git will handle much more gracefully than SVN: See Merge Git vs. SVN for concrete examples.

Problem

As the title suggests, I am curious as to why so many people tout Git as a superior alternative to branching/merging over SVN. I am primarily curious because SVN merging sucks and I would like an alternative solution. How does Git handle merging better? How does it work? For example, in SVN, if I have the following line: Hello World! Then user1 changes it to: Hello World!1 then user2 changes it to: Hello World!12 Then user2 commits, then user1 commits, SVN would give you a conflict. Can Git resolve something simple as this?

Original source

Related problems