What is the difference between all the different types of version control?

后端 未结 13 650
心在旅途
心在旅途 2020-12-03 01:46

After being told by at least 10 people on SO that version control was a good thing even if it\'s just me I now have a followup question.

What is the difference betwe

相关标签:
13条回答
  • 2020-12-03 01:51

    To everyone just starting using version control:

    Please do not use git (or hg or bzr) because of the hype

    Use git (or hg or bzr) because they are better tools for managing source code than SVN.

    I used SVN for a few years at work, and switched over to git 6 months ago. Without learning SVN first I would be totaly lost when it comes to using a DVCS.

    For people just starting out with version control:

    • Start by downloading SVN
    • Learn why you need version control
    • Learn how to commit, checkout, branch
    • Learn why merging in SVN is such a pain

    Then switch over to a DVCS and learn:

    • How to clone/branch/commit
    • How easy it is to merge your branches back (go branch crazy!)
    • How easy it is to rewrite commit history and keep your branches
      up to date with the main line (git rebase -i, )
    • How to publish your changes so others can benefit

    tldr; crowd:

    Start with SVN and learn the basics, then graduate to a DVCS.

    0 讨论(0)
  • 2020-12-03 01:51

    Version Control is essential to development, even if you're working by yourself because it protects you from yourself. If you make a mistake, it's a simple matter to rollback to a previous version of your code that you know works. This also frees you to explore and experiment with your code because you're free of having to worry about whether what you're doing is reversible or not. There are two major branches of Version Control Systems (VCS), Centralized and Distributed.

    Centralized VCS are based on using a central server, where everyone "checks out" a project, works on it, and "commits" their changes back to the server for anybody else to use. The major Centralized VCS are CVS and SVN. Both have been heavily criticized because "merging" "branches" is extremely painful with them. [TODO: write explanation on what branches are and why merging is hard with CVS & SVN]

    Distributed VCS let everyone have their own server, where you can "pull" changes from other people and "push" changes to a server. The most common Distributed VCS are Git and Mercurial. [TODO: write more on Distributed VCS]

    If you're working on a project I heavily recommend using a distributed VCS. I recommend Git because it's blazingly fast, but is has been criticized as being too hard to use. If you don't mind using a commercial product BitKeeper is supposedly easy to use.

    0 讨论(0)
  • 2020-12-03 01:54

    Eric Sink has a good overview of source control. There are also some existing questions here on SO.

    0 讨论(0)
  • 2020-12-03 01:54

    The simple answer is, do you like Undo buttons? The answer is of course yes, because we as human being make mistakes all the time.

    As programmers, its often the case though that it can take several hours of testing, code changes, overwrites, deletions, file moves and renames before we work out the method we are trying to use to fix a problem is entirely the wrong one and the code is more broken than when we started.

    As such, Source Control is a massive Undo button to revert the code to an earlier time when the grass was green and the food plentiful. And not only that, because of how source control works, you can still keep a copy of your broken code, in case a few weeks down the line you want to refer to it again and cherry pick any good ideas that did come out of it.

    I personally (though it could be called overkill) use a free Single user license version of Source Gear Fortress (which is their Vault source control product with bug tracking features). I find the UI really simple to use, it supports both the checkout > edit > checkin model and the edit > merge > commit model. It can be a little tricky to set up though, requiring you to run a local copy of ISS and SQL server. You might want to try a smaller program, like those recommended by other answers here. See what you like and what you can afford.

    0 讨论(0)
  • 2020-12-03 01:54

    See also this SO question:

    • Difference between GIT and CVS
    0 讨论(0)
  • 2020-12-03 01:56

    I would start with:

    • A Visual Guide to Version Control
    • Wikipedia

    Then once you have read up on it, download and install SVN, TortoiseSVN and skim the first few chapters of the book and get started.

    0 讨论(0)
提交回复
热议问题