tags:

views:

18545

answers:

20
+25  Q: 

Svn vs Git

I am starting a new distributed project where some of the developers will not be in the same country... What should I use: Git or SVN?

Why?

PS. It is a smart client application running on windows and will be developed using Visual Studio

[UPDATE] And does it work on MacOS (Not required but interesting to know)?

+4  A: 

I would opt for SVN since it is more widely spread and better known.

I guess, Git would be better for Linux user.

Burkhard
+3  A: 

Git is not natively supported under Windows, just yet. It is optimized for Posix systems. However running Cygwin or MinGW lets you run Git successful.

Nowadays I prefer Git over SVN, but it takes a while to get over the threshold if you come from CVS, SVN land.

Define 'natively'. msysgit works just fine
Milan Babuškov
+4  A: 

Definitely svn, since Windows is—at best—a second-class citizen in the world of git (see http://en.wikipedia.org/wiki/Git_(software)#Portability for more details).

UPDATE: Sorry for the broken link, but I've given up trying to get SO to work with URIs that contain parentheses. [link fixed now. -ed]

Hank Gay
FYI: enclose the URL in angle brackets, or replace parentheses with %28 and %29.
PhiLho
Will the URL-encoding work for the []() syntax?
Hank Gay
Instead of "Definitely svn", I'd "IF you use Windows svn", if the user doesn't use it, he doesn't care about it's support.
Hugo
@Hugo the question indicates it will be developed using Visual Studio, which is (was?) Windows-only, so they probably do care.
Hank Gay
+3  A: 

I would probably choose Git because I feel it's much more powerful than SVN. There are cheap Code Hosting services available which work just great for me - you don't have to do backups or any maintenance work - GitHub is the most obvious candidate.

That said, I don't know anything regarding the integration of Visual Studio and the different SCM systems. I imagine the integration with SVN to notably better.

Christoph Schiessl
+2  A: 

The main point is, that Git is a distributed VCS and Subversion a centralized one. Distributed VCSs are a little bit more difficult to understand, but have many advantages. If you don't need this advantages, Subversion may the better choice.

Another question is tool-support. Which VCS is better supported by the tools you plan to use?

And Git works on Windows at the moment only via Cygwin or MSYS. Subversion supported Windows from the beginning. As the git-solutions for windows may work for you, there may be problems, as the most developers of Git work with Linux and didn't have portability in the mind from the beginning. At the moment I would prefer Subversion for development under Windows. In a few years this may be irrelevant.

Mnementh
I am optimistic that the horizon of irrelevancy will be much shorter than a few years.
Greg Hewgill
Yes, possibly it will only one year. Git has a dynamic development-community. But subversion has too. In a year or two you will have to look at both again to answer this question.
Mnementh
+2  A: 

May I expand on the question and ask if Git work well on MacOS?

Reply to Comments: Thanks for the news, I'd been looking forward to trying it out. I'll install it at home on my Mac.

Robert Gould
Yes, it works beautifully. I installed it through MacPorts and use it daily.
Greg Hewgill
It does. It's great on any POSIX-based system (Unix, Linux, Solaris, BSD, etc). It's really just Windows where the problem lies.
Oli
and the git-gui and gitk probably work the same under OS-X as under Linux and Windows. Contrary to tortoiseSVN, which AFAIK is windows-only?
David Schmitt
@David Schmitt: well, http://tortoisesvn.tigris.org/ calls it a "Windows Shell Extension for Subversion", so I'd assume so, yes ;-).
SamB
@Robert: how was your experience with git on OS X?
David Schmitt
+35  A: 

SVN is one repo and lots of clients. GIT is a repo with lots of client repos, each with a user. It's decentralised to a point where people can track their own edits locally without having to push things to an external server.

SVN is designed to be more central where GIT is based on each user having their own GIT repo and those repos push changes back up into a central one. For that reason, GIT gives individuals better local version control.

The problem you'll face is the Windows-aimed GIT client market is still pretty small. Extremely small, in fact. GIT is only currently great on POSIX based systems (Unix, BSD, Linux, Solaris and their derivatives). There is a little gui that ships with GIT that works under a POSIX layer, but it's hardly as intuitive or powerful as TortoiseSVN.

If you're looking on getting out of SVN, you might want to evaluate Bazaar for a bit. It's one of the next generation of version control systems that have this distributed element. It isn't POSIX dependant like git so there are native Windows builds and it has some powerful open source brands backing it.

But you might not even need these sorts of features yet. Have a look at the features, advantages and disadvantages of the distributed VCSes. If you need more than SVN offers, consider one. If you don't, you might want to stick with SVN's (currently) superior desktop integration.

Oli
Might also have a look at Hg (Mercury)
Joel
Native builds, if using a scripting language is considered native... By the same logic, Git is native - it just needs a program (cygwin or msys) to run it.
mathepic
Things have gotten much better since October 2008. You can install TortoiseGit, grab the latest portable version of MSysGit, and tell TortoiseGit where to find it. I just moved my big svn repo over to git today because svn's poor renaming support finally made me mad enough.
jnylen
Moving on 2 years we now have some good windows tools. Currently I'm using netbeans with MSysGit. I've also had good luck with TortoiseGit. I think it's good enough to be used in production. Considering how hard it is to manage simple conflicts in subversion git is a huge improvement.
Keyo
+6  A: 

I would set up a Subversion repository. By doing it this way, individual developers can choose whether to use Subversion clients or Git clients (with git-svn). Using git-svn doesn't give you all the benefits of a full Git solution, but it does give individual developers a great deal of control over their own workflow.

I believe it will be a relatively short time before Git works just as well on Windows as it does on Unix and Mac OS X (since you asked).

Subversion has excellent tools for Windows, such as TortoiseSVN for Explorer integration and AnkhSVN for Visual Studio integration.

Greg Hewgill
+2  A: 

SVN seems like a good choice under Windows, as pointed by other people.

If some of your developper wants to try GIT, it may always use GIT-SVN where the SVN repository is recreated in a GIT repository. Then he should be able to work locally with GIT and then use SVN to publish its changes to the main repository.

Pierre
+4  A: 

have you tried Bzr?

It's pretty good, connonical (the people who make Ubuntu) made it because they didn't like anything else on the market...

Omar Kooheji
The windows support really does need a bit of work here, though. Not so much that I haven't been quite happily using it for all of my recent programming under Windows (of which I've been doing a fair bit), or anything, but still...
SamB
It almost 100% of the time with OS, that people "made it [any software] because the didn't like anything else in the market".
Hugo
+25  A: 

Why is git better than Subversion?

Prakash
Sorry, I did not see this one! tnx
rudigrobler
+18  A: 

I have never understand this concept of "git not being good on Windows"; I develop exclusively under Windows and I have never had any problems with git.

I would definitely recommend git over subversion; its simply so much more versatile and allows "offline development" in a way subversion never really could. Its available on almost every platform imaginable and has more features than you'll probably ever use.

Dark Shikari
I, on the other hand, had quite some problems with git on windows, it did really strange things to my repo. And I was using the most recent version in cygwin (it was something like a month ago).
Roman Plášil
@Roman: well, the Cygwin port is hardly the same thing as the native win32 port. I expect the Cygwin port is much less well-tested...
SamB
+2  A: 

You have to go with a DVCS, it is like a quantum leap in source management. Personally I use Monotone and its sped up development time no end. We are using it for Windows, Linux and Mac and it has been very stable. I even have buildbot doing nightly builds of the project on each of the platforms.

DVCS while being distributed usually means you will create a central server just for people to push changes to and from.

Phil Hannent
+7  A: 

Not really answering your question but if you want the benefits of Distributed Revision Control - it sounds like you do - and you're using Windows I think you'd be better off using Mercurial rather that Git as Mercurial has much better Windows support. Mercurial does have a Mac port too.

Dave Webb
+2  A: 

I agree with Dave Webb. If you are working on Windows, then you should be considering Mercurial; not Git. There is even a shell plugin - TortoiseHg - available

David Arno
+3  A: 

There is an interesting Video on YouTube about this. Its from Linus Torwalds himself: Goolge Tech Talk: Linus Torvalds on git

knight_killer
+3  A: 

If your team is already familiar with version and source control softwares like cvs or svn, then, for a simple and small project (such as you claim it is), I would recommend you stick to SVN. I am really comfortable with svn, but for the current e-commerce project I am doing on django, I decided to work on git (I am using git in svn-mode, that is, with a centralised repo that I push to and pull from in order to collaborate with at least one other developer). The other developer is comfortable with SVN, and while others' experiences may differ, both of us are having a really bad time embracing git for this small project. (We are both hardcore Linux users, if it matters at all.)

Your mileage may vary, of course.

ayaz
+4  A: 

The funny thing is: I host projects in Subversion Repos, but access them via the Git Clone command.

Please read Develop with Git on a Google Code Project

Although Google Code natively speaks Subversion, you can easily use Git during development. Searching for "git svn" suggests this practice is widespread, and we too encourage you to experiment with it.

Using Git on a Svn Repository gives me benefits:

  1. I can work distributed on several machines, commiting and pulling from and to them
  2. I have a central backup/public svn repository for others to check out
  3. And they are free to use Git for their own
Andre Bossard
+6  A: 

2 key advantages of SVN that are rarely cited:

  1. Large file support. In addition to code, I use SVN to manage my home directory. SVN is the only VCS (distributed or not) that doesn't choke on my TrueCrypt files (please correct me if there's another VCS that handles 500MB+ files effectively). This is because diff comparisons are streamed (this is a very essential point). Rsync is unacceptable because it's not 2-way.

  2. Partial repository (subdir) checkout/checkin. Mercurial and bzr don't support this, and git's support is limited. This is bad in a team environment, but invaluable if I want to check something out on another computer from my home dir.

Just my experiences.

"please correct me if there's another VCS that handles 500MB+ files effectively" - Perforce of course!
james creasy
Perforce = non free. Also, Perforce is not available for all platforms.
Hugo
Why not put the SVN repo INSIDE the truecrypt containers? You could also tunnel that though ssh, and configure the server to store that particular repo inside another truecrypt file. This has the added advantage that you can make partial checkouts of that repo.
Hugo
+3  A: 

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).

VonC