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?
The difference between Git and SVN version control systems is that Git is a distributed version control system, whereas SVN is a centralized version control system. Git uses multiple repositories including a centralized repository and server, as well as some local repositories.
SVN is better than Git for architecture performance, binary files, and usability. And it may be better for access control and auditability, based on your needs.
This basic syntax— svn merge URL —tells Subversion to merge all changes which have not been previously merged from the URL to the current working directory (which is typically the root of your working copy).
Git merging combines sequences of commits into one unified history of commits. There are two main ways Git will merge: Fast Forward and Three way. Git can automatically merge commits unless there are changes that conflict in both commit sequences.
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With