Possible Duplicate:
Merging: hg/git vs. svn
I've heard/read that Git and DVCS's in general are better than Subversion and centralized version control systems. And one of the reasons I've heard for this is that merging is so much better in DVCS's than in centralized system.
What is the difference between the two when it comes to merging? What makes Git better than Subversion when you're re-integrating a branch, for instance?
Many people prefer Git for version control for a few reasons: It's faster to commit. Because you commit to the central repository more often in SVN, network traffic slows everyone down. Whereas with Git, you're working mostly on your local repository and only committing to the central repository every so often.
Git has the advantage that it's MUCH better suited if some developers are not always connected to the master repository. Also, it's much faster than SVN. And from what I hear, branching and merging support is a lot better (which is to be expected, as these are the core reasons it was written).
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.
It's not so much the fact that they're distributed, but more that they keep track of changesets rather than versions. (However, distributed systems usually work with changesets, while centralized ones often use versions; this is because distributed systems just won't work with a version-based approach, while centralized systems can get away with it).
Subversion says, OK, first I had this version and then I had that version. And then when it's time to merge, it takes the two versions, compares them, and makes educated guesses on how to combine them. Git, mercurial, and similar SCMs, say, OK, first I had nothing, then someone made this change and then someone else made that change, etc. When it's merge time, basically all they need to do is apply the changes in the correct order, correcting for line numbers here and there and taking file renaming into account, but that's basically it.
Subversion doesn't really have enough information to perform an intelligent merge: it only sees the differences, but not where they come from.
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