Slashdot Mirror


Practical Reasons To Choose Git Or Subversion?

markmcb writes "I develop Rails applications and recently followed my lemming herd and made the switch to Git after learning some of the practical advantages Git offers over Subversion. As I'm sure there are many die-hard Subversion fans in the Slashdot audience, I'm curious what your key reasons are for sticking with Subversion. If possible, I'd like reasons that apply to 'most of the time' as opposed to arguments based on obscure features that may get used only a few times ever."

10 of 667 comments (clear)

  1. Familiarity? by gorrepati · · Score: 5, Insightful

    Thats all there is it to it, oh mighty one!

    --
    You will never have experience until after you needed it.
  2. Re:IDE Integration by Tester · · Score: 4, Insightful

    Clearly, you've never used git to think that some UI can make subversion usable.. Try merging a reasonably-sized branch with subversion (and you'll fail and cry and ask why oh why you didnt use git).

  3. Re:go with Perforce by 32771 · · Score: 4, Insightful

    >Note that Perforce is free for open source projects.

    Yeah, so was BitKeeper and that used to really work too.

    --
    Je me souviens.
  4. Re:IDE Integration by Haeleth · · Score: 4, Insightful

    I don't use the command line for my source control. IDE Integration means a lot...

    You feel free to wait around for "integration". The command-line client is already nicely integrated into my IDE, which is the most mature, most stable, and most flexible one in widespread use: Unix.

  5. Re:IDE Integration by Wonko · · Score: 4, Insightful

    Simpler solution: stop merging reasonably-sized branches.

    I know that's not reasonable for every situation, but about 90% of the time I see people doing lots of branching and merging, it's a response to screwed-up organizations or dysfunctional personal relationships.

    I constantly branch and merge even when I am the only one working on a codebase. When branching and merging are so easy why wouldn't you take advantage of it? Of course, it is always possible that I have a dysfunctional relation with myself.

    That's not to say git isn't awesome for certain situations, mind you.

    I can't speak for how awesome git is, I've never used it.

    But branching and merging adds a fair bit of overhead, and anything that increases a project's overhead should be your last resort, not your first.

    If branching is increasing your workload instead of making things easier you are most likely not using a source control system that is good at branching and merging.

  6. Re:My own opinion (prob. very controversial) by Prien715 · · Score: 4, Insightful

    You've obviously never worked on a programming team.

    The best reason to use CVS or Git is the situation where multiple programmers are touching the same file(s) at once and you need to both commit. Also, the blame tool on SVN lets you easily tell when any given line of the code was added and why (see the commit message). The SVN repository I work on professionally has well over 25K commits...try managing that with a bunch of copies and text files!

    (I've done the versioned tarballs for a project I worked on alone...never again!)

    --
    -- Political fascism requires a Fuhrer.
  7. Re:IDE Integration by dubl-u · · Score: 4, Insightful

    I constantly branch and merge even when I am the only one working on a codebase. When branching and merging are so easy why wouldn't you take advantage of it?

    I do, too. I call it "checking out" and "committing". I do it every few hours.

    If branching is increasing your workload instead of making things easier you are most likely not using a source control system that is good at branching and merging.

    When I'm building a unified product, what need would I have of branching and merging? If I'm not sure if something is a good enough idea to build, I don't build it. Or I build a quick, throw-away implementation to check an idea out. And then I throw it away.

    No matter how good a source control system is at branching and merging, it can't solve the real cost: maintaining a understanding of different, semi-incongruent notions of the project, and then resolving those differences. The whole point of branching is to increase complexity, and excess complexity is the enemy of every good software project. As Occam's razor says, you shouldn't multiply entities beyond that which is strictly necessary.

    That's not to say I never branch. But it's always a last resort for me, no matter how awesome the source control system is.

  8. Re:IDE Integration by Abcd1234 · · Score: 4, Insightful

    When I'm building a unified product, what need would I have of branching and merging? If I'm not sure if something is a good enough idea to build, I don't build it. Or I build a quick, throw-away implementation to check an idea out. And then I throw it away.

    So you've never implemented something and then wished you could revert a change that didn't work out? Or have never wanted to incrementally implement something without incorporating it into the final product until it was fully complete? Really?

  9. Re:Keyword: Herd by jimdread · · Score: 5, Insightful

    I like to use git because I find it easy to make a branch for testing out some new code, and easy to merge the branch into the trunk if I want to keep it. Here are some aliases I wrote that cover pretty much all the git I use. If I decide to change version control systems, I can change the aliases. alias vca='git add .'; alias vcb='git branch'; alias vcc='git commit -a'; alias vcd='git diff'; alias vcm='git merge'; alias vco='git checkout';

    As for choosing between git and subversion, why not try both? It's pretty unlikely that somebody will tell you what you like best. You have to find out for yourself. Considering that they are free software, easy to install, and pretty easy to use, you can try both and see if one of them seems better to you. I tried both, and I chose git. But I don't mind if other people use subversion, RCS, SCCS, or whatever they feel like using.

    Subversion and git have different models. Subversion has a client-server model with the repository accessible by http. Git uses a distributed model, with each user getting their own copy of the repository, and the possibility of merging things from one repository to another. This might make git work better if the users' computers aren't always able to connect to a remote repository.

    Try them both, see which one you prefer.

  10. Re:IDE Integration by musicmaker · · Score: 5, Insightful

    So I guess you've never worked in the real world, where corporate mandates a change that has to go out before EOB same day, or where you are half way through a feature set impl, and management changes the priorities. What do you do with that code then? Or when the CTO ups and quits, and his info has to be yanked from the website in 30 minutes or less.

    Often you need three branches at least, one for dev, one for staging, and one for production. And that's not counting the system rewrite branch that might be bumbling along in the background perpetuated by another developer whose been assigned to fixing all the wrongs in the current system.

    And let's not even start down the path of trying to integrate people's work in subversion who are in a big team when someone has gone three weeks without a commit because they are working on a major new feature. And that's not even starting to talk about database updates and how they have to be applied in the process between co-ordinating developers.

    Then we can talk about the offshore development team who isn't trusted to put changes into the main branch without a peer review from someone onshore.

    And then you get sued by a competitor who accuses you of stealing their code because you hired one of their developers and they have some random bit of proof, so you have to make a new branch to incorporate whatever random changes legal decides are appropriate to mitigate that, that have to be reviewed by an independent third party who takes three weeks to do anything, and you can't just stop development and wait for them.

    And what happens when you have to update the docs that should be in version control too for someone else, particularly manuals for a release that is concurrent with ongoing development, or even historic because something somebody put in the manual six months ago has turned out to be wrong, and they have to be updated for that release that people are still buying.

    Showing product to the client (because that's who really calls the shots, not the product manager) every few hours is just plain impractical. Most people don't want to see updates every few hours, they want a finished product in clear review cycles. They don't have the time to review the entire system every few days let alone every few hours. A full QA cycle for a normal sized product can last a week. Do you just stop development while they do a full QA before a release?

    And let's not even mention bugs that are transient and may only show up six months down the road when more people start using the system, like race conditions which have become apparent in code that was written two years ago and nobody remembers for toffee. What about storage checking - the system was written by someone who thought that storage would never run out, so why check to see if there is enough space on the disk to complete the operation, and the application crashes and is down for a while while some poor sysadmin tries to find more disk space.

    And the application that wasn't maxing out the network until it was deployed at a client with 300 users, and now you have to go back and rework your com model from a year ago. It's not exactly a bug, but you're gonna have to fix it anyway.

    What about a large scale integration with a pre-existing piece of software that might take a month to complete? You can unit test each piece of it sure, but you can't release the whole thing until the integration is totally complete.

    There are SO many reasons you have to have branches in the real world.

    --
    Everyone is living in a personal delusion, just some are more delusional than others.