Here is a copy of an answer I made of some duplicate question since then deleted about Git vs. SVN (September 2009).
Better? Aside from the usual link WhyGitIsBetterThanX, they are different:
one is a Central VCS based on cheap copy for branches and tags
the other (Git) is a distributed VCS based on a graph of revisions.
See also Core concepts of VCS.
That first part generated some mis-informed comments pretending that the fundamental purpose of the two programs (SVN and Git) is the same, but that they have been implemented quite differently.
To clarify the fundamental difference between SVN and Git, let me rephrase:
SVN is the third implementation of a revision control: RCS, then CVS and finally SVN manage directories of versioned data. SVN offers VCS features (labeling and merging), but its tag is just a directory copy (like a branch, except you are not "supposed" to touch anything in a tag directory), and its merge is still complicated, currently based on meta-data added to remember what has already been merged.
Git is a file content management (a tool made to merge files), evolved into a true Version Control System, based on a DAG (Directed Acyclic Graph) of commits, where branches are part of the history of datas (and not a data itself), and where tags are a true meta-data.
To say they are not "fundamentally" different because you can achieve the same thing, resolve the same problem, is... plain false on so many levels.
- if you have many complex merges, doing them with SVN will be longer and more error prone.
if you have to create many branches, you will need to manage them and merge them, again much more easily with Git than with SVN, especially if a high number of files are involved (the speed then becomes important)
- if you have partial merges for a work in progress, you will take advantage of the Git staging area (index) to commit only what you need, stash the rest, and move on on another branch.
- if you need offline development... well with Git you are always "online", with your own local repository, whatever the workflow you want to follow with other repositories.
Still the comments on that old (deleted) answer insisted:
VonC: You are confusing fundamental difference in implementation (the differences are very fundamental, we both clearly agree on this) with difference in purpose.
They are both tools used for the same purpose: this is why many teams who've formerly used SVN have quite successfully been able to dump it in favor of Git.
If they didn't solve the same problem, this substitutability wouldn't exist.
, to which I replied:
"substitutability"... interesting term (used in computer programming).
Off course, Git is hardly a subtype of SVN.
You may achieve the same technical features (tag, branch, merge) with both, but Git does not get in your way and allow you to focus on the content of the files, without thinking about the tool itself.
You certainly cannot (always) just replace SVN by Git "without altering any of the desirable properties of that program (correctness, task performed, ...)" (which is a reference to the aforementioned substitutability definition):
- One is an extended revision tool, the other a true version control system.
- One is suited small to medium monolithic project with simple merge workflow and (not too much) parallel versions. SVN is enough for that purpose, and you may not need all the Git features.
- The other allows for medium to large projects based on multiple components (one repo per component), with large number of files to merges between multiple branches in a complex merge workflow, parallel versions in branches, retrofit merges, and so on. You could do it with SVN, but you are much better off with Git.
SVN simply can not manage any project of any size with any merge workflow. Git can.
Again, their nature is fundamentally different (which then leads to different implementation but that is not the point).
One see revision control as directories and files, the other only see the content of the file (so much so that empty directories won't even register in Git!).
The general end-goal might be the same, but you cannot use them in the same way, nor can you solve the same class of problem (in scope or complexity).