Techblog

Tech Blog

Our latest geek adventures!

9 December Git vs SVN for bosses

Posted by jaap on in Collaboration

We switched to Git this morning. Before making this switch Gert-Jan (CTO of Floorplanner) asked me: “what is the advantage of Git over Subversion?”. I answered him and thought I’ll make a post of the answer as it can be useful for other bosses like Gert-Jan.

Since we started using Subversion, which was a couple of years ago, using a code versioning tool helped us a lot. We could work on Floorplanner with the whole team together without storing the “repository” on our remote FTP location (early days) or emailing changes up and forth (ancient times ;-) ). But when working with Subversion for some time, little things started to bother, i’ll sum them up:

1. We needed tutorials for creating a branch in SVN every time again
2. When merging the branch back, SVN didn’t know where that branch started.
3. When merging the branch back, each change was recorded back as the user who did the merge.

The consequences of these disadvantages.

We avoided creating branches.

Why is not creating branches bad practice?

I’ll give you an example. Sometimes when we were working on some big feature, we didn’t create a branch (it was a lot of work), we just committed it into the trunk when it was “kinda” ready. Then a sudden exception in the software that was online occurred, we now had a problem! That bug had to be fixed NOW, but the changes we just committed into the trunk were not fully tested and couldn’t go online. You understand this was a tedious process and resulted in more downtime sometimes.

But why is Git better?

1. Creating branches in Git is a lot easier than doing this in SVN.
2. Git keeps track where branches come from. So when creating a branch, merging back is very simple.
3. It keeps commit messages intact, when merging.

Conclusion

The whole point, remember this post is called “Git vs SVN for bosses”, branching is a joy in Git and this results in better being able to have access to different versions of the same software at the same time, which again results in being able to fix that bug NOW.

Other resources

http://git.or.cz/gitwiki/GitSvnComparsion

Tags: ,

18 Responses to “Git vs SVN for bosses”

  1. Willem van Bergen Says:

    In my opinion, there is another important reason why one should use Git as version control system if you are developing a Rails application. As a Rails developer, you are part of the Rails community and ecosystem. Most Rails developers and related projects have switched to Git by now. It makes your life much easier if you switch to Git as well because of three reasons:

    1. You can collaborate easier, not only because Git is more suitable for collaboration, but because your fellow developers know how to use Git as well.
    2. Plugins can easier be integrated in your main project tree using Git submodules.
    3. You can easily fork repositories of plugins or gems you need to make your own application-specific changes or to ensure they remain compatible with your application. At the same time, it’s easy to track to main development line of the original project. GitHub is ideal for this purpose.

    It basically comes down to a “me too”-attitude, but you can see this attitude yields some advantages.

  2. Working with git branches | Floorplanner Tech Blog Says:

    [...] Jaap finally convinced Gert-Jan, we have moved to the Git version control system for the main Floorplanner repository. Now we can [...]

  3. Rupert P. Fillywick Says:

    Subversion 1.5 added merge tracking. Seems like a shallow set of reasons to drop all the existing tool support for subversion and switch to an entirely new VCS.

  4. Rupert P. Fillywick Says:

    Willem —

    Forking a project to maintain compatibility is band-aid for a broken project. If the project does not maintain a stable API, that’s a problem they need to fix, rather than forcing every single downstream client to maintain compatibility across the project’s lifetime.

    If you need to make your own local changes to the project, these should be submitted upstream to release yourself from the maintenance overhead, and benefit the others using it. If your changes are local hacks, either you should reconsider your reasons for hacking up the project, or this demonstrates the project lack of extensibility and apparent unsuitability for the task at hand.

    These arguments seem to be about facilitating the use of bad code and poor practices. That’s not compelling.

  5. Willem van Bergen Says:

    In a perfect world, you would have a point. Unfortunately, the Ruby on Rails world, which is most relevant to us, is not stable. APIs change from time to time, relying on the internals of the Rails framework causes problems every few releases, plugins change frequently, etc. This immaturity of the framework is not ideal, but it is the situation we are facing.

    Git makes managing this situation much easier: You can create local forks of projects that you know work for your project. Because git is distributed, it is very easy to incorporate changes from the official branch.

    About tools: this depends on what you are used to. I always used the command line interface client of SVN, so switching to git wasn’t really hard. It would have been much more difficult if I was used to tools like SVN integration in Eclipse or TurtoiseSVN.

  6. Chad Says:

    Uh. I’m pretty sure it’s damn easy to create a branch in svn. It’s simply an svn copy command from the trunk directory to the branch directory.

  7. jaap Says:

    You’re right creating is easy, merging it all back is somewhat mre complex :p

  8. Kiall Says:

    Merging branches is not hard at all with subversion 1.5

    to create the branch…
    “svn copy ”

    to merge the branch back into trunk…
    “svn merge –reintegrate ”

    Subversion 1.5 has been out for nearly 10 months now.. (and 7 months at the time of the post’s writing). If you havent kept track of your dev tools for 7 months, then its entirely your fault that merging was hard! Surely ruby developers are used to the whole keeping up thing with how fast ruby changes…

  9. Kiall Says:

    humm I always forget certian things will get scrapped by comment filters ;)

    to create the branch…
    “svn copy URL_TO_TRUNK URL_TO_BRANCH”

    to merge the branch back into trunk…
    “svn merge –reintegrate URL_TO_TRUNK”

  10. Chris Says:

    If you’re developing in Windows, you may also want to consider Mercurial which gives pretty much the same advantages as Git only with Windows support (TortoiseHg, etc).

  11. C Says:

    So SVN or Git?

    Then you have Perforce, Mercurial, Launchpad with Bazaar, Visual Source Safe and so on. (CVS is kind of dead…)

    SVN can’t (easily) lock a tree, Git is “all or nothing” access rights (and hates your Windows), others have their own quirks as well.

    So again: It depends on the project which one you will use most efficiently.

    It would be useful to have a real and objective comparison of these solution, so each project with a short reading could decide which solution is the best for them.

  12. Gert-Jan Says:

    I found this presentation of Scott Chacon on git very useful! http://scotland-on-rails.s3.amazonaws.com/1A02_Scott_Chacon.mp4

  13. Matt-W Says:

    SVN 1.5 does have merge tracking yes, but it doesn’t have the property of preserving the original authorship attribution on the merged commits, which I consider very important and a primary reason why my workplace should switch to git.

    Unfortunately, convincing everyone else we should switch to git, including the management, is not likely to be easy.

  14. Being John…uhm…Bader » Blog Archive » Link collection about version control systems Says:

    [...] Git vs SVN for bosses (Stupid I think) [...]

  15. Sukesh Nambiar Says:

    I think git vs subversion is a topic that one can debate till the world ends.

    I have used both git and subversion. Both has its strength and weakness. I could not find one better than the other.

    Git uses distributed repository concept and support private branches and quick merges etc. This is extremely useful handy in indepependent and experimental software development.

    Subversion uses centralized repository and is useful for organizations that want to keep the source control very tight and look for an integrated development environment.

    All these boils down to your development philosophy. With subversion 1.5, branching is not that very difficult.

    So a choice may be made based on your development philosophy and your need. Trying to find the best and using it will not be a viable solution.

  16. Git-ing Started: My Journey to with Git – j.c. crosby Says:

    [...] Git vs. SVN for Bosses: http://techblog.floorplanner.com/2008/12/09/git-vs-svn-for-bosses/ [...]

  17. Belug Says:

    Hi, i don’t think there is a debate about witch one is the best between SVN and GIT. The thing is witch one suite the best the need you have. If found this website talking about the pro and con of GIT vs SVN.

    http://git.or.cz/gitwiki/GitSvnComparsion

    It’s based on SVN 1.5 hope this will help some of you to choose your best!

  18. Anonymous Says:

    [...] [...]

Leave a Reply