Git vs SVN – Which is Better?

Samorai Tux PenguinGit and SVN are version control systems. Both are better than no version control system so you win no matter which you choose. There are some important differences between Git and SVN which might make one more suitable for your type of project than the other. It’s not a question of which is better, but which is best suited for your situation and development process.

SVN is easier to use than Git

SVN has been around longer. There are tons of tools available which make using it easier for non-technical users. SVN error messages make more sense. If the version control system will be used by managers, graphic designers or other non-developers, SVN is a better choice. With TortoiseSVN anybody tech-savvy enough to browse for files can easily use SVN. Git has a much higher learning curve than SVN.

Why is Git so popular if it’s harder to use?

Git is the new kid on the block, SVN is old-school. Don’t get me wrong, Git deserves it’s popularity. Git is fast and excellent for managing large open source projects with many collaborators. While branching is possible with SVN, branching and merging is what Git was built to do. Git may be harder to learn, but once you do learn how to use Git, you’ll find it to be very feature rich and functional. Another huge advantage to Git is the GitHub website which makes programming a social activity. GitHub lets you connect with and follow other developers, sort of like Facebook for software developers. It makes coding more fun, and even makes it possible for less technical people to take part in the development process.

What is the main difference between Git and SVN?

Subversion offers a centralized model whereas Git offers a decentralized model. What does this mean? With git, everyone has their own copy of the entire repository. Basically, everyone is always working on their own branch and functional code can later be merged into the master. With SVN, everyone has a working copy and changes are committed to a central repository. To work on a branch a user must copy the trunk into another directory and then merge it back when complete.

Why are you using Git for Battle City?

Battle City is an open source multiplayer game. It’s a big project which I hope will grow to have many developers from all around the world. So why not create an SVN repository for Battle City? In my experience, Git better manages the chaos involved with an open source project that has many collaborators contributing random bits of code. SVN is better suited for a more structured development process, where tasks are defined and the team knows who is working on what.

Git allows any developer to sit down, get a copy of the Battle City repository, and then just start messing around with whatever they feel like. Eventually, once the developer is ready to share their changes, they can push their code their own branch of Battle City. GitHub makes it possible to easily track and follow other branches, and eventually, good changes in a branch can be merged into the master. In my experience, Git with GitHub will make managing user contributions and maintaining a master version much easier than SVN.

Confused? The GitHub website is full of helpful documentation and resources to help you get started!

So… Should I use Git or Subversion?

It’s really a matter of preference. Anything you can do with one you can do with the other. If your project involves lots of branching and merging, I’d recommend Git. Keep in mind, not all projects involve branching or merging.

Take Battle City for example. Before Battle City was released as open source, back when only one or two people worked on the code at any given time, all commits were done to a central SVN repository. This made sense because there was a project plan and list of features to develop. It was easy to watch the central repository and track progress.

Once Battle City was released as open source, development became a free-for-all. Contributors could work on anything, experiment with new ideas, even create conflicting items. If all commits were still done to a central repository, the project would never again compile and so branches became important.

Branching can still be done with SVN and within a company or organization this might make sense because a manager could check progress of new features by looking at the commits on branches and merges to the trunk. With open source however, you don’t care what others are doing or about tracking their progress, you are simply thankful for any contribution.

Git allows users to download their own copy of the repository, do their own thing, and check back in if ever they have anything useful they want to share.

Git vs SVN Conclusion

So should you use Git or should you use Subversion? Take a look at your situation and your project and make a decision because neither is best, but one is often better for what you are doing.

Related posts from around the web:

http://robwilkerson.org/2008/04/05/subversion-or-git/
http://git.or.cz/gitwiki/GitSvnComparsion

Need Fast Reliable Web Hosting?

Need to register a web site? Sign up with Host Gator! Yes, that’s an affiliate link, but let me tell you why you’ll click it anyways… Host Gator is affordable, fast and reliable. Most importantly, they have the best service of any web host I have dealt with including an easy to use Help & Support Forum. You speak to real people, not robots or people reading a generic script.

Once you try Host Gator, you’ll never register a website anywhere else.

  • Pingback: nvie.com » Blog Archive » A successful Git branching model

  • http://weecology.org Ethan

    Thanks for this post. I’m just starting to use version control and trying to decide between Git and Subversion and this is the clearest, most useful description of the differences between the two that I’ve read.

  • Umar

    Thanks a lot for the post. I am currently using SVN and now planning to migrate to GIT. This post helped me to make the right choice.

  • Marty Brandon

    Good post. Thanks for doing a factual comparison of the two and suggesting guidelines for making a decision.

  • William

    Very nice post, helped me understand what is Git, and realized I don’t need it at this point.

  • Gavin Punch

    SVN is much better than GIT. Git is rubbish.

    • http://www.looble.com/ deceth

      I disagree with your opinion, but applaud your use of the word rubbish. Well done sir.

    • Sd

      I totally agree with u. Git rubbish

      • http://www.looble.com/ deceth

        If this blog were three-dimensional, it would be much easier to crush your avatar between my fingertips.

  • http://www.larsson.tc Fredrik Larsson

    Solid post! I can imagine the need for both SVN and Git depending of the project as you state. Been using SVN for quite some time so I don't imagine I will convert to Git but when working on big open source projects I can definately see the need of working with Git insteald. Question is if there will be a future SVN-release to solve the issue that arise in big open source projects.

  • http://www.sebastienlachance.com SebastienLachance

    Thank you for the clarification. Now I can make a decision regarding git vs svn.

  • Pingback: svn » Twitter Trends

  • Pingback: HOWTO: Il modello di branching di Git « diegor in ?*

  • The Crab Walker

    GIT is much better than SVN.

    Say goodbye to unintuitive propsetting and merging/branching.

    If you are stuck at an organization who insists on using SVN, check out git-svn for local development.

    All the intuitiveness and features of GIT for your local development, but you can still checkout/commit/update to/from the company SVN repo.

    The only place I've run into problems with git-svn is if a project uses SVN externals.

  • sims

    “SVN is old-school”

    No it's not really. CVS is old-school. I remember compiling SVN from source so I could use fsfs. I wanted to use SVN to store images. I think that was in 2005. That's hardly old-school.

    • http://www.looble.com/ deceth

      When it comes to technology, 2005 is way old-school. No Android, no iPhone, no publicly available Facebook until 2006, no Twitter…

      I don't mean old-school to say it's out of date. I mean to say it's been around through many iterations, it's robust, it's proven, but it's not the new cool toy.

  • programmer

    ¡Great Article! Tidy and useful.

  • http://www.facebook.com/people/Joel-Regen/771359931 Joel Regen

    thanks. nice article. I'll stick with SVN for now…but it is good to know about git.

  • http://www.facebook.com/people/Joel-Regen/771359931 Joel Regen

    ok, so, here's an idea much more useful than a game – all you coders out there who want to change the world to be about 100X better (unimaginably better IMHO), go read this:
    http://www.amazon.com/End-Money-Future-Civilization/dp/1603580786

    then, go create software that will implement a global network of highly decentralized (think P2P on steroids) payment exchanges (think paypal without interest or taxes and only modest fee) that will eliminate all forms of fiat currency (money that is dictated into use by corrupt regimes that inflate/deflate it to suit the needs of the few at the expense of the many).

    Now, go and write some killer code! Let's save the planet using our brains instead of our testosterone encrusted weapons.

  • Ceedalisay

    I think GIT or SVN it's up to user and what will be comfortable to them. If you need REPO host you cn check https://www.assembla.com/plans=carmelad , they offer free 30 day trial.

  • Ceedalisay

    I think GIT or SVN it's up to user and what will be comfortable to them. If you need REPO host you cn check https://www.assembla.com/plans=carmelad , they offer free 30 day trial.

  • Pingback: How to Sync Your USB Stick with an SVN Repository – Looble... Looble!

  • http://www.umbeehosting.co.uk/vps-hosting Virtual Server Hosting

    I remember Battle City when I was in grade school, Contra and Bomberman is a good strategy game too. I never thought that SVN could be converted into GIT.

  • http://mindinventory.com/mobile_apps_dev.php Mobile Apps Development

    Git and SVN  have some cons and pron,I like to use git,it’s so many features are  available.SVN is not  to  easy to use.

  • http://www.thesixfiguretrainingsystem.com/ How to Make Money Online

    Nice presentation!
    I think  SVN is nearly same to Git but SVN may slightly better then Gif because SVN is easy to use.

    • Toni Almeida

      I agree! SVN is way better than Gif!
      But Git stills better than SVN …

  • http://www.essayeditingservices.net/effective-help-of-professional-dissertation-editors/ dissertation editors

     I prefer SVN because it is easy to use comparably Gif.
    I am still using SVN for 6 month will be continue with it.  
     

  • kenyee

    Centralized management is probably the main reason to choose svn…Companies prefer this usually