views:

1482

answers:

12
+16  Q: 

Git or Subversion?

Assuming that I'm starting a new web project at home using Visual Studio, which version control system, viz. Git or Subversion will be better to use? Which one will have the least setup complexity?

+4  A: 

Git is a distributed source control setup and as you are the only user I can't imagine that you would benefit much from its features. Subversion is (in my opinion) easier to set up so I would recommend you go with it.

Andrew Hare
The disconnected aspect of Git can be quite useful for a single developer. I work a lot on the train without internet connections ...
Guillaume
“Setting up” Git is easier: “git init”. Bang, your repository and your working tree is ready to use. :)
Bombe
Would he benefit from lacking the features git have?
Magnus Hoff
...but linus will think you are ugly and stupid!
Matt Briggs
Sounds like you've never actually tried Git:) Assuming you completely ignore the distributed aspects of git (which isn't very hard), it's far less braindead than subversion, particularly around things like merges. It's also significantly faster in all operations, with more flexibility.
Scotty Allen
I'm a diehard SVN user and know very little of git, but latley I've been bitten once too many times by the lack of distributedness and merging problems with SVN... I think I'm going to investigate git for my next project (at least until SVN 2.0 comes out)
rmeador
I read on some question here that Mercurial was easier to get into than Git, so that's what I'm setting up at home. Just because I use subversion at work.
David Thornley
Have those of you who don't like SVN's merging tried the new merge tracking support in subversion 1.5? Not trying to be an advocate here, necessarily; I haven't gotten to play with it yet either. But I'm looking forward to it.
Jenn D.
+3  A: 

Which one you decide to use depends a lot on what your needs are now and going forward. Git has a very nice community built a round it with GitHub which is great for sharing code and projects. SVN is pretty simple to setup and get going, but in large teams Git has it beat hands down with it's branching and merging. This is ideal in cases where you have multiple people working on the same project, either in an office setting or an OSS sense where the team is spread out.

If all you need is something quick and simple to setup and get going so you can start your project, SVN should be fine. SVN is also integrated into many editors and IDE's as well as many bug tracking and continuous integration systems.

If you plan on having a team, or already do, Git is worth looking at for its branching and merging setup. Git however, due largely to still being kind of young, doesn't have nearly as much support available

Steven Surowiec
+37  A: 

Since this is for your own personal playing around, my question is simple: Do you know Subversion or Git already?

  • If you know SVN - use Git.
  • If you know Git - use SVN.

If you don't know either - use SVN. It's a better introduction.

Tom Ritter
best answer by far, +1
Matt Briggs
Or just use darcs, mercurial, or bazaar. Subversion and git are already far too popular and therefore un1337, and if you use them you will become un1337 too.
Justice
I feel bad screwing up the 7,777 rep, but I must. +1
John MacIntyre
Unclear to me what makes svn a better introduction? It seems that only people who know svn or cvs think git is hard to use.
Dustin
svn is good to use because it teaches you, in 3 or 4 commands, exactlyhow a version control system should not work.
jrockway
@jrockway I'll +1 one of your answer/question just for that comment :)
Frederic Morin
Great answer, I was ready to read over the pro's and cons but this just sums it up. They both have their advantages so knowing both and knowing when to use both is the best solution.
Ryan Detzel
Plus the svn red-book is really something exceptional.
Arafangion
+8  A: 

Subversion is far more Windows-friendly in my experience and also more immediately useful for the solo developer.

Another possibility is Perforce, which is slightly less Windows-friendly, but full featured and fairly easy to use, not to mention free for up to two users.

Jekke
If you want a bit more windows friendly distributed VCS, I'd recommend Mercurial. The tortoise shell client for that is pretty decent, and it works well enough for most cases.
Erik van Brakel
bazaar is another DVS that supports windows better. No Cygwin, no Msys, no git.
ceretullis
+12  A: 

I'd go with Git. It's not that bad getting up to speed on the basics (there are now a ton of good resources, including learn.github.com) and it'll pay off in spades. And I've been using it on Vista with no probs.

fig
What is the benefit of using Git for a home project?
Hortitude
Essentially it gets out of your way, making versioning something that 'just happens' as opposed to something you have to work at. Even on a home project, you'll be more agile in terms of branching and overall workflow. Plus if the project ever expands, you can more easily get others involved.
fig
Also, git doesn't put .svn folders all over the place. which keeps the code base cleaner. And, seriously, it is far easier to branch, merge, squash commits.
Abizern
+3  A: 

If you are working alone and want some kind of version control easy to use, then use Subversion.It works great on Windows, setting up the repository is one right click in an empty with Tortoise SVN. Ankh SVN provides a very good integration with Visual Studio - almost on par with TFS provided you use VS 2005 or more recent.

On the other hand, Git is much more promising than SVN. I'll check it during this year, but third party tools are not on par yet.

Johan Buret
A: 

If you plan to take your project along on an USB stick, use Subversion. Windows XP it really, really, really bad at caching lots of small files on an USB stick. Git writes many small files for commit operations and that takes ages on Windows.

[EDIT] The problem with Windows XP and files on an USB stick is caching (or the lack thereof). To prevent data loss, XP will always write files synchonously on an USB stick (so any write will come back only after the FS has reported that all blocks have been written to the stick). Add that to the fact that USB sticks are slow when handling small files (they have a lot of overhead initializing their wear level management) which leads to very poor performance for any kind of application which writes lots of small files.

[EDIT2] If you put a SVN checkout on the USB stick, you will also have a lot of small files (especially in the .svn directories). So the solution in this case is to put the Subversion repository (the "server") on the USB drive. The repository uses only a bunch of big files (if you use the database option instead of the file based one: svnadmin create --fs-type bdb). This avoids the "many little files problem". There is no way to achieve the same thing with current versions of Git.

Aaron Digulla
Care to back up any of this?
Gregg Lind
What do you want to know?
Aaron Digulla
A non-issue here : ZIP on the fly works wonder against this phenomenon. More over, if you were to backup a Subversion working folder, you'd run in the same kind of issues, since .svn folder keeps a copy of every file.
Johan Buret
@Johan: With SVN, you can keep the repository on the stick which contains only a few large files.
Aaron Digulla
With Git you can put *additional* repository to exchange information on USB stick (bare, i.e. without working tree), or you can use git-bundle which was meant for sneakernetting.
Jakub Narębski
When I tried, git-bundle wasn't available. And I already said why even a bare repository is slow on Windows XP.
Aaron Digulla
+1  A: 

Let's my ride-in on your question and ask:

  1. Does Git work on Windows?
  2. Does it have something that's equivalent to Tortoise? (otherwise I don't see how it could compete with SVN in terms of ease-of-use)

On a side note: If it's really a one man home project, you don't really need any source control tool. Just put your project in a DropBox folder and you're done (auto-commits, infinite revisions, undelete). Unless you really think you're going to need tags and branches and stuff. But for personal home projects... do ya?

Assaf Lavie
1 - yes, 2 - not yet, and to answer your final question - yes.
anon
DropBox is great, but IMO its revisions feature isn't quite up to the task of managing an entire project. If you need to revert an entire directory back to an earlier state there isn't an easy way to do it. (I just keep a SVN working copy in my DropBox folder, so I get the best of both worlds. :))
Brant Bobby
TortoiseSVN is considerably better on XP than Vista, since on XP it integrates better with Windows Explorer. For what it does on Vista, I'd be almost as well off using SVN directly from the command line.
David Thornley
I've started a few projects that were only 'pets' which quickly grew in popularity, so I'm glad that I used a standard VCS from the beginning. You never know when that's going to happen .. so its better to be prepared.
Tim Post
There is TortoiseGit, there is Git Extensions, and there are beginnings of GitCheetah
Jakub Narębski
+4  A: 

I'd go with Mercurial instead. It's supposed to be similar to Git (which I never could get running because of the Windows issue) and is really easy to setup in Windows & very nice for "personal" version control systems.

Jason S
+1 for this. Mercurial allows the flexibility of a DVCS with a very simple and intuitive subversion like interface. Someone used to SVN could very quickly get comfortable with HG and vice-versa. The only time I use git is when I need its branching capabilities, which are far superior to HG's
Tim Post
+1  A: 

If you want Visual Studio integration there is no question. Only Subversion has Visual Studio integrations (AnkhSVN, VisualSVN and several scripts that allow access to TortoiseSVN).

One of the most important reasons that Subversion has such a large amount of tools written for it is that it was designed as a stable library for use by multiple clients.

It's unlikely that Git gets the same level of integration in Visual Studio before git support is available as some kind of reusable library. (There are plans for a libgit2 that could make this a reality).

Bert Huijben
+1  A: 

You can make your own opinion after reading this : http://whygitisbetterthanx.com

Gilles Philippart
+1  A: 

With SVN you will have to set up a server, create a repository there, check out the (empty) repository, add your files, and then commit.

With Git, all you need is git init in your project's root directory. Then you can add and commit files as you see fit.

There's not really any idea in setting up a Subversion server, since you're the only one working on the source. Contrary to what many people think, solo projects is a perfect match for distributed version control tools. It's also very easy to grow your project later on.

Daniel Schierbeck