Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

No question that the majority of debates over programmer tools distill to either personal choice (by the user) or design emphasis, i.e., optimizing design according to particular uses cases (by the tool builder). Text Editors are probably the most prominent example--a coder who works on a Windows at work and codes in Haskell on the Mac at home, values cross-platform and compiler integration and so chooses Emacs over Textmate, etc.

It's less common that a newly introduced technology is genuinely, demonstrably superior to the extant options.

I wonder if this is in fact the case with version-control systems, in particular, centralized VCS (CVS, SVN) versus distributed VCS (git, hg)?

I used SVN for about five years, and SVN is currently used where I work. A little less than three years ago, I switched to git (and gitHub) for all of my personal projects.

I can think of a number of advantages of git over subversion (and which for the most part abstract to advantages of distributed over centralized VCS), but I cannot think of one contra example--some task (that's relevant and arises in a programmers usual workflow) that subversion does better than git.

The only conclusion I have drawn from this is that I don't have any data--not that git is better, etc.

My guess is that such counter-examples exist, hence this question.

share|improve this question
7  
SVN Trivia: In the book "Beautiful Code" shop.oreilly.com/product/9780596510046.do SVN is mentioned as a very good example of good code and API. – powtac Sep 30 '11 at 12:34
2  
@jokoon: Efficient in terms of what? Surely not speed since even fast Ethernet is slow compared to local operations. – maaartinus Sep 30 '11 at 20:59
1  
See this StackOverflow Q: Why to use SVN? Any hidden pros (over GIT/Mercurial/Bazaar) there? – detly Oct 1 '11 at 5:00
18  
+1 for the way you've worded the question: excellent distinction between the objective and subjective elements, and a very balanced question as a result. – Mark Whitaker Oct 1 '11 at 9:03
1  
+1 @Mark Whitaker for that observation – therobyouknow Oct 1 '11 at 16:29
show 8 more comments

18 Answers

up vote 105 down vote accepted

Subversion is a Central repository

While many people will want to have distributed repositories for the obvious benefits of speed and multiple copies, there are situations where a central repository is more desirable. For example, if you've got some critical piece of code that you don't want anyone to access, you'd probably not want to put it under Git. Many corporations want to keep their code centralized, and (I guess) all (serious) government projects are under central repositories.

Subversion is Conventional Wisdom

This is to say that many people (especially managers and bosses) have the usual way to number the versions and seeing the development as a "single line" along time hardcoded into their brain. No offense, but Git's liberality is not easy to swallow. The first chapter of any Git book tells you to blank out all the conventional ideals from your mind and start anew.

Subversion does it one way, and nothing else

SVN is a Version Control system, it has one way to do its job and everybody does it the same way. Period. This makes it easy to transition to/from SVN from/to other centralized VCS. Git is NOT even a pure VCS -- it's a file-system, has many topologies for how to set up repositories in different situations -- and there is no standard. That makes is harder to choose one.

Other trivial ones can be

  • SVN supports empty directories
  • SVN has better Windows support

-- UPDATE --

  • Being able to check out only sub-trees is an important advantage I forgot to mention
  • Another is more control over files and directories with svn lock
share|improve this answer
32  
"Subversion does it in one way" -- I thought so too, until I started my current job. In my current job, my boss, who claims not to have trust issues, configured the server to require locking. No merging happens in our system. Files are locked on the repository and nobody else can write them without the lock. Top-down control, for those whose constitutions demand it, is definitely something svn does better than git. – Dan Ray Sep 30 '11 at 12:16
8  
One advantage of the central repository is ease of backups. If all the checked in code is in one place, and that one place has off-site backup, you don't lose everything if your office burns down. With a DVCS, unless you do off-site backups of the developer's machines, you lose everything that hasn't been pushed to the server that's backed up off-site. – Paul Tomblin Sep 30 '11 at 12:27
46  
Why can't git be used in a centralized manner? Just have one central repository, and your devs can clone and pull and push like they checkout and update and commit. – David Thornley Sep 30 '11 at 14:12
10  
@PaulTomblin - Depending on workflow, Git can provide better backups. For instance, we use private github repos and I frequently push my code up to feature branches. If my coworkers do git fetch origin, each of them has a backup of my code, along with whatever backup Github itself provides. (We regularly prune merged branches, both locally and on Github.) – Nathan Long Sep 30 '11 at 15:27
13  
You seem to imply that central is more secure for large companies or governmental work. This is simply not true. If you have a copy of the code on your computer, you have a copy of the code. It doesn't matter if it came from a central server or a central file system holding a DVCS repository. – John Fisher Sep 30 '11 at 17:32
show 18 more comments

One benefit of subversion over git can be that subversion allows checking out sub-trees only. With git the whole repository is a unit, you can get only all or nothing. With modular code, this can be quite nice compared to git submodules. (While git submodules have their place, too, obviously)

And a small tiny benefit: Subversion can track empty directories. Git tracks file contents, so a directory without any file won't show up.

share|improve this answer
8  
Working with sub trees is IMHO the only thing SVN has over GIT. Point taken, empty directories are nice, but not necessary either (and can be worked around). If git submodules and git subtree were less confusing there would be nothing holding many people back from migrating to GIT. The other advantages some people mentioned boil down to (developer) mentality. E.g. if you need top to bottom, that's fine. I wouldn't have any work for you though. – Till Sep 30 '11 at 15:13
2  
An actual technical advantage! +1 - really the only answer so far that actually answers the question! – Rex Kerr Sep 30 '11 at 15:20
2  
It's funny how these are the only kinds of things that can be argued in favour of SVN (and other centralized version control) – dukeofgaming Mar 7 '12 at 6:39
1  
Why is it funny? - Newer systems learn from older systems. There's even a benefit with RCS over git: The history files can easily be edited by hand and you can have per-file branches. But eolution involves that features are lost ... – johannes Mar 8 '12 at 22:03
3  
As of git version 1.8.0, you can now use the git subtree command to accomplish exactly this. Last subversion advantage bites the dust :) Details here: github.com/gitster/git/blob/… Note: Even though this is a link to a github project, git-subtree is now part of the core git distribution. – carleeto Nov 19 '12 at 4:25
show 1 more comment

I can think of three. First, it is quite a bit easier to grok, especially for non developers. Conceptually it is much simpler than dcvs options. Second is maturity, especially tortiseSVN on windows. TortiseHG is catching up fast though. Third, the nature of the beast--just an image of a filesystem where you can check things out from any level of the tree--can come in pretty handy in some scenarios -- like versioning a variety of widely different config files across dozens of servers without dozens of repositories.

This isn't to say we aren't moving all development over to hg.

share|improve this answer
19  
Being easier to grok is an important advantage, since that makes it more likely to be used. SVN is certainly way better than no version control, and if someone is stubborn about old ways then maybe SVN is the best choice for them. – jhocking Sep 30 '11 at 11:58
8  
@jhocking: I don't love SVN, but if someone tells me "I don't like these new DVCS things, so I'll stay with CVS", then I'll definitely recommend it: it's the easy road to at least partially sane VCS ;-) – Joachim Sauer Sep 30 '11 at 12:10
2  
@jhocking New ways aren't always the best for every circumstance. It brings to mind the old story about NASA spending millions of dollars developing a pen that can write in 0g. The cosmonauts on the other hand made due with pencils. Sometimes the old ways are better, NOW GET OFF MY LAWN! – maple_shaft Sep 30 '11 at 12:14
17  
@maple_shaft, and sometimes they aren't. snopes.com/business/genius/spacepen.asp – Peter Taylor Sep 30 '11 at 12:19
8  
@PeterTaylor I can't believe I have just been snoped... The shame... :( – maple_shaft Sep 30 '11 at 12:41
show 8 more comments
  • SVN repos are more manageable from manager's and admin's point of view(ACL + auth methods + hotcopy + mirrors + dumps)
  • SVN *-hooks are easier to implement and support
  • svn:external has more power and flexibility than submodules
  • filesystem-based repo trees are easier to use than monolithic repos with logical-only separation
  • SVN has more different client-tools
  • SVN has third-party usable web-frontend, much better than Git's
  • SVN doesn't break your brain
share|improve this answer
4  
Doesn't break your brain? Wanna teach me how to easily merge branches with conflicts in SVN? – WarrenT Aug 30 '12 at 23:17
show 1 more comment

This is all relative, and like maple_shaft said, if one works for you, don't change!

But if you really want something, I'd say it is maybe better for designers, web programmers and such - it handles images and binary files a bit better.

share|improve this answer
1  
+1 for binary files - very important in some use cases – sylvanaar Sep 30 '11 at 15:59
1  
How does SVN handle them better? Git considers every file a BLOB. – WarrenT Aug 30 '12 at 22:59
2  
@WarrenT because of the workflows, with git you're branching and merging a lot (or why bother using it) and you just can't realistically merge binaries. Hence, you often put the "needs lock" property on binary files in SVN. – gbjbaanb Oct 19 '12 at 19:03
show 1 more comment

I appreciate that you are looking for good information but this kind of question just invites, "I think Git is so much win, and svn teh suxorz!" answers.

I tried and personally found Git a little much for my small team. It seemed like it would be great for a large distributed team or group of teams that are geographically dispersed. I understand greatly the benefits of git, but source control in my opinion isn't something that keeps me up at night.

I am a deer hunter, and when me and my friends go out they are armed to the teeth, bristled with ammo and high tech gear. I show up with a single rifle, seven bullets and a buck knife. If I need more than seven rounds then I am doing something wrong and I do as well as anybody else.

The point I am trying to make is that if you are a small team working on a medium to small project and you are already familiar with svn then use it. It is certainly better than CVS or (shudder) SourceSafe and it doesn't take me more than 5 minutes to set up a repository. Git can sometimes be overkill.

share|improve this answer
2  
Really? Then I'd suggest you have a look at fossil. – Spencer Rathbun Sep 30 '11 at 12:39
5  
let's not sound the alarm at the slightest possibility of controversy. Important topics are often the most controversial and the ones most likely to invoke strongly held views. So "This kind of question" is important and the possibility of an out-of-bounds response is not a plausible to not post it. I assume the users on this Site are adults. What's more the way my Q was phrased, was if not neutral, then deferential to subversion folks--responsive answers to my Q will have to recite advantages of subversion over git, not the other way around. – doug Sep 30 '11 at 12:39
7  
@Spencer - Contrariwise, as a user of both git and hg, I would suggest mercurial for anyone who thinks git is too much. TortoiseHG would be very familiar to anyone used to TortoiseSVN (it even shares the same Explorer overlays on Windows). It's certainly a lot easier than VSS and I would be surprised if it took more than a few seconds to set up an hg repo, commit the initial state and clone it to a shared drive. – Mark Booth Sep 30 '11 at 13:16
show 4 more comments

When you don’t need to branch and merge, svn (with tortiseSVN on windows) is very easy to understand and use. Git is over complex for the simple cases, as it tries to making branching/merging easy.

(A lot of small projects never have to branch if they are managed well. Git is aimed at the complex cases; therefore most git documentation assumes you need to do complex operations like branching and merging.)

share|improve this answer
4  
Using git branching and merging are no complex operations. I even use branches in a one-man project, even when there are no requirements for multiple version. Keeping work you can't continue at the moment in a branch, branching when you find out that trying another solution may be much better... However, I agree that git is a bit harder to learn. – maaartinus Sep 30 '11 at 21:16
show 1 more comment

I wrote this as a comment on somebody else's answer, but I guess it deserves to be an answer in and of itself.

My company's carefully-chosen configuration for svn requires file-level locking to edit content, and never ever ever uses merge. As a result, multiple developers contend for locks and it can be a major bottleneck, and there's never ever any chance of merge conflict.

SVN definitely does top-down managerial control better than git. In my skunkworks migration to git (asking forgiveness rather than permission) I've terrified my manager many times with the notion that there's no software-enforced Centeral Master Controlling Server To Which We are All Slaves.

share|improve this answer
4  
This is, in fact, the reason Linus Torvalds hates SVN. Of course, what doesn't he hate? – Jonathan Henson Sep 30 '11 at 14:24
11  
@JonathanHenson He likes blueberries on his Cheerios but that doesn't mean that it is a superior breakfast either. – maple_shaft Sep 30 '11 at 14:49
1  
@maple_shaft I wasn't claiming the superiority of anything, just stating that whether or not SVN's centrality is a good thing entirely depends upon perspective. – Jonathan Henson Sep 30 '11 at 15:09
show 2 more comments

My reasons:

  • maturity - both the server, and the tools (e.g. TortoiseSVN)
  • simplicity - less steps involved, a commit is a commit. DVCS such as Git and Mercurial involve commit, then push.
  • binary handling - SVN handles binary executables and images better than Git/Hg. Especially useful with .NET projects since I like to check build-related tools into source control.
  • numbering - SVN has a readable commit numbering scheme, using just digits - easier to track revision numbers. Git and Hg do this quite differently.
share|improve this answer
1  
+1 for mentioning revision numbers – rds Nov 9 '11 at 11:15
1  
"commit numbering scheme" is only possible if you have canonical trunks. Otherwise which one gets the major numbering? – user1249 Mar 10 '12 at 13:32
1  
+1 the numbring in svn. This number is unique. there are tools to use this number as part of the app-versionnumber xx.yy.zz.12882 where 12882 is the svn version-number. If there is a production problem you can ask vor the versionnumber and you have the exact svn-revision where the software was build with – k3b Jan 7 at 18:57

Usability. It's not really subversion's merit but rather TortoiseSVN's.. TortoiseGit exists but still has a long way to go to match TortoiseSVN.

If you asked what git does better than SVN I would reply "github". It's funny how 3rd party tools make such a huge difference.

share|improve this answer
1  
Assembla (for any supported SCM - SVN in list) is better than github, I think – Lazy Badger Oct 1 '11 at 6:56

At work I couldn't switch the devs from SVN to any DVCS for two reasons:

  • partial checkouts (like only 3 folders from different depths in the project tree)
  • file locking (binary format reports)
share|improve this answer
1  
centralized vcs are better for locking (necessary for binary files). nothing else. – Thiago Arrais Oct 11 '11 at 19:27

Well, my grandpa could use SVN on his windows XP computer, but he'd have trouble using git. Maybe this is more an accomplishment of TortoiseSVN over TortoiseGit, but I think it's rather tied to the fact, that git is inherently more powerful and thus more complex and it would be pointless to dumb it down to the same level.

Now it doesn't really matter for my grandpa, because he does no programming as of late. However, I was once on a team, where our graphic artists were using our source control as well.
And those are people who simply expect their tools to work (so do I, but I have a realistic chance to get them to work in case of failure) and be intuitive. Apart from the fact, that it would had been quite an effort to get them to get along with a DVCS, there was little to be gained. And with only dwo programmers in the team, it made sense for us to also just stick with SVN.

share|improve this answer

I post this as a response rather than a comment.

I admit than DVCS are quite in the trend right now, but I'll try to tell why.

DVCS are better because just like lots of people have been saying, "this is the way we should have been working from the beginning". It's true, you can do with a DVCS what you used to with SVN, so in a way that makes SVN obsolete.

However, not every software project is as good as it gets:

  • Long term project have a lot benefited from DVCS, because it uses less overhead, allows much better management (branching etc), and is greatly supported by hosts like google code and github.

  • Those projects are not the only ones, there are other kind of projects that are being developed in companies without any assistance from the outside world or internet: everything is done internally, and often on a short term. A good example: a video game. Code evolves rapidly.

For the latter case, developers don't really need branching or sophisticated features DVCS can offer, they just want to share source code and assets. The code they make is not likely to be reused, because there is a deadline. They rely on SVN rather than a DVCS because of several reasons:

  • Developers have machines that belong to the company, and this might change rapidly. Configuring a repo is a loss of time.
  • If those guys don't have their own machine, they are less likely to be working on the same source code/part of the project. Plus one for the centralized data.
  • network speeds and big money allows the use of a centralized server that deal with everything SVN, it's bad practice but backups are made etc.
  • SVN is just simpler to use, even if it's the wrong way: synchronizing files on peers without redundancy is not a simple problem, and "do it the right way" just cannot make it in time if you always want it to be perfect.

Think about the game industry machine and how SVN is a time saver; people communicates much more on those projects because games are about repetitive programming and adaptive code: there is nothing hard to code, but it has to be done the right way, ASAP. Programmers are hired, they code their part, compile it, test it a little, commit, done, game testers will deal with the rest.

DVCS are made for the internet and for very complex project. SVN are for small, short term, tight team projects. You don't need to learn a lot from SVN, it's almost a FTP with a dumb diff.

share|improve this answer

Other people have posted some pretty good answers, but what about Permissions? Using Subversion over SSH, you can make a separate account on your server for SVN. Different developers can be given different access to different parts of the repository. Can GIT do that? I guess there is gitolite, but it just doesn't seem as flexible or robust to me, nor do I know anyone who is actually using it.

share|improve this answer
1  
Others have hit this in mentioning "top-down managerial control". This is a key element for my environment - we have certain areas of our repositories that need to be locked down to read-only or even no-read for some user groups. We also need to have a single location we can point at and say "this is the authoritative master copy, if your copy doesn't match what's here, it's not official." – alroc Jan 7 at 19:23
show 2 more comments

There are two major trends in version control right now; Distribution, and Integration.

Git is great at decentralization.

SVN has lots of tools built that integrate with it. It's common to set up your SVN server so that when you check in a fix, you mention the bug number in the checkin comment, and it automatically sets that but to an "in testing" state, and alerts the assigned tester that they need to look at it. Then you can tag a release and get a list of all the bugs fixed in this release.

The tools that do this with SVN are mature, and used every day.

share|improve this answer

Speed. Sometimes takes 10 or 15 minutes to clone a big git repository, while a similar sized subversion repository takes a couple of minute to check out.

share|improve this answer
2  
But checkout/cloning is a rare operation. In most scenarios, git is faster than subversion. – rds Nov 9 '11 at 11:16
1  
git clone --depth=1 is your friend if you don't care for history – Hubert Kario Jan 7 at 14:53

Below is the 2 reason, so that i still stay with SVN.

  1. The learning curve , SVN is easier then GIT, even the setup (server or client too), usability , command.
  2. Better server package like Subversion edge, visualSVN, uberSVN etc.
share|improve this answer

Subversion and Git both encourage particular (and very different) approaches to development and collaboration. Some organizations will get more out of Git, and others will get more out of Subversion, depending on their organization and culture.

Git and Mercurial are both excellent for distributed and loosely organized teams of highly competent professional programmers. Both of these popular DVCS tools encourage small repositories, with reuse between developers taking place via published libraries with (relatively) stable interfaces.

Subversion, on the other hand, encourages a more centralized and tightly coupled management structure, with more communication between developers and a greater degree of organizational control over day-to-day development activities. Within these more compactly organized teams, reuse between developers tends to take place via unpublished libraries with (relatively) unstable interfaces. TortoiseSVN also permits Subversion to support multidisciplinary teams with members who are not professional programmers (e.g. systems engineers, algorithms engineers or other subject-area specialists).

If your team is distributed, with members either working from home or from many different international sites, or if they prefer to work alone and in silence, with little face-to-face communication, then a DVCS like Git or Mercurial will be a good cultural fit.

If, on the other hand, your team is located on a single site, with an active "team" approach to development, and lots of face-to-face communication, with a "buzz" in the air, then SVN may be a better cultural fit, particularly if you have lots of cross-disciplinary teams.

Of course, it is possible to configure Git and Hg (powerful and flexible as they are) to do pretty much whatever you want, but it is definitely more work, and they are definitely harder to use, particularly for those members of the team who would not naturally be inclined to use any form of version control whatsoever.

Finally, I also find that sharing functionality using "hot" library development under Svn (with CI & a test-driven approach) permits a pace of coordinated development that is difficult to achieve with a more distributed and loosely-coupled team.

share|improve this answer

protected by Mark Trapp Oct 2 '11 at 11:14

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.

Not the answer you're looking for? Browse other questions tagged or ask your own question.