+ Reply to Thread
Results 1 to 4 of 4

Thread: Difference between Git and Subversion

  1. #1
    joseph's Avatar
    joseph is offline Website Master Achievements:
    500 Experience Points1000 Experience Points5000 Experience Points10000 Experience PointsRecommendation Second Class
    joseph has disabled reputation
    Join Date
    2008-09-08
    Posts
    412

    Default Difference between Git and Subversion

    Here're three answers... much informative:

    Git is not better than Subversion. But is also not worse. It's different.
    The key difference is that it is decentralized. Imagine you are a developer on the road, you develop on your laptop and you want to have source control so that you can go back 3 hours.

    With Subversion, you have a Problem: The SVN Repository may be in a location you can't reach (in your company, and you don't have internet at the moment), you cannot commit. If you want to make a copy of your code, you have to literally copy/paste it.

    With Git, you do not have this problem. Your local copy is a repository, and you can commit to it and get all benefits of source control. When you regain connectivity to the main repository, you can commit against it.

    This looks good at first, but just keep in mind the added complexity to this approach.

    Git seems to be the "new, shiny, cool" thing. It's by no means bad (there is a reason Linus wrote it for the Linux Kernel development after all), but I feel that many people jump on the "Distributed Source Control" train just because it's new and is written by Linus Torvalds, without actually knowing why/if it's better.

    Subversion has Problems, but so does Git, Mercurial, CVS, TFS or whatever.

  2. #2
    joseph's Avatar
    joseph is offline Website Master Achievements:
    500 Experience Points1000 Experience Points5000 Experience Points10000 Experience PointsRecommendation Second Class
    joseph has disabled reputation
    Join Date
    2008-09-08
    Posts
    412

    Default

    With git, you can do practically anything offline, because everybody has their own repository.

    Making branches and merging between branches is really easy.

    Even if you don't have commit rights for a project, you can still have your own repository online, and publish "push requests" for your patches. Everybody who likes your patches can pull them into their project, including the official maintainers.

    It's trivial to fork a project, modify it, and still keep merging in the bugfixes from the HEAD branch.

    Git works for the linux kernel developers. That means it is really fast (it has to be), and scales to thousands of contributors. Git also uses less space (upto 30x less space for the Mozilla repository).

    Git is very flexible, very TIMTOWTDI (There is more than one way to do it). You can use whatever workflow you want, and git will support it.

    Finally, there's github, a great site for hosting your git repositories.

    Drawbacks of git:

    * it's much harder to learn, because git has more concepts and more commands.
    * revisions don't have version numbers like in subversion
    * many git commands are cryptic, and error messages are very user-unfriendly
    * it lacks a good GUI (such as the great TortoiseSVN)

  3. #3
    joseph's Avatar
    joseph is offline Website Master Achievements:
    500 Experience Points1000 Experience Points5000 Experience Points10000 Experience PointsRecommendation Second Class
    joseph has disabled reputation
    Join Date
    2008-09-08
    Posts
    412

    Default

    Other answers have done a good job of explaining the core features of Git (which are great). But there's also so many little ways that Git behaves better and helps keep my life more sane. Here are some of the little things:

    1. Git has a 'clean' command. SVN desperately needs this command, considering how frequently it will dump extra files on your disk.
    2. Git has the 'bisect' command. It's nice.
    3. SVN creates .svn directories in every single folder (Git only creates one .git directory). Every script you write, and every grep you do, will need to be written to ignore these .svn directories. You also need an entire command ("svn export") just to get a sane copy of your files.
    4. In SVN, each file & folder can come from a different revision or branch. At first, it sounds nice to have this freedom. But what this actually means is that there is a million different ways for your local checkout to be completely screwed up. (for example, if "svn switch" fails halfway through, or if you enter a command wrong). And the worst part is: if you ever get into a situation where some of your files are coming from one place, and some of them from another, the "svn status" will tell you that everything is normal. You'll need to do "svn info" on each file/directory to discover how weird things are. If "git status" tells you that things are normal, then you can trust that things really are normal.
    5. You have to tell SVN whenever you move or delete something. Git will just figure it out.
    6. Ignore semantics are easier in Git. If you ignore a pattern (such as *.pyc), it will be ignored for all subdirectories. (But if you really want to ignore something for just one directory, you can). With SVN, it seems that there is no easy way to ignore a pattern across all subdirectories.
    7. Another item involving ignore files. Git makes it possible to have "private" ignore settings (using the file .git/info/exclude), which won't affect anyone else.

  4. #4
    joseph's Avatar
    joseph is offline Website Master Achievements:
    500 Experience Points1000 Experience Points5000 Experience Points10000 Experience PointsRecommendation Second Class
    joseph has disabled reputation
    Join Date
    2008-09-08
    Posts
    412

    Default

    You can check it here: GitSvnComparsion - GitWiki

+ Reply to Thread

Similar Threads

  1. LWN: Subversion 1.6.11 released
    By edenCC in forum Technology News
    Replies: 0
    Last Post: 2010-04-18, 08:31 PM
  2. LWN: Subversion 1.6.11 released
    By edenCC in forum Technology News
    Replies: 0
    Last Post: 2010-04-18, 03:23 PM
  3. LWN: A proposed Subversion vision and roadmap
    By edenCC in forum Technology News
    Replies: 0
    Last Post: 2010-04-03, 03:55 PM
  4. LXer: Git gets demystified and Subversion control
    By edenCC in forum Technology News
    Replies: 0
    Last Post: 2009-08-05, 09:09 AM
  5. Replies: 0
    Last Post: 2009-07-21, 09:06 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts