I get a few questions that come up repeatedly as a developer and this is one of them; Why should I use source control?; Which should I use?
I used to be in that position at the beginning of my career, now? There’s no way I’d go back to this:
Here’s the scenario I think a lot of companies out there are working with:
- One (or more) server(s) containing
- MS Exchange
- Customer accounts
- Other business specific data
- Several PC/Laptops connected to the server
In these companies I think people work by copying files from your server, modifying files on their own PC, then saving them back into the respective clients’ folders. This may work for the first few clients because you can’t keep track of the latest version of your product/sotware but when it comes to upgrade to your latest and greatest version…uh oh. Migration is a pain.
Problems I imagine they may still encounter:
- Bugs reappearing
- Not knowing which version of code is the right one or latest
- Two people can’t work on the same project very easily
- You shout across the office to say “is anyone using xxx”
Not all source control systems fix all of these issues but many will make your life easier.
Read this to explain why you need source control!
I have some experience with the following and will try to explain my thoughts
- Microsoft Visual Source Safe
- An old souce control solution now and much hated by many who have had any experience with any other system!
- Developer must check in a file before another can access it. If the first developer leaves without checking files in, you had better get their password!
- Not free
- Microsoft Team Foundation Server
- This is a powerful enterprise tool at enterprise prices
- Good integration with Visual Studio (which I imagine you don’t use)
- Integration with a build server (more info on request)
- Supports branching and merging
- Very not free
- Centralised Source Control – there is a master copy of all code. You have to check in to the master code repository
- You can work offline locally but you can’t check anything in
- Windows integration with http://tortoisesvn.tigris.org/
- Free with support option
- Distributed Source Control – each copy of the source control is its own repository and you can work on code, checking in changes, without having a connection to the server
- Command line but has tools available for windows shell integration (TortoiseGit)
- I have no experience with
- Command line much like Git but also has tools available (http://tortoisehg.bitbucket.org/)
I’m interested in more but I see the above reappearing most often, in my work at least
I think this is a good illustration of source control with Subversion (borrowed from http://hginit.com/top/00.html):
This is a really good article discussing what source control provider to use based on your needs:
A quote from the above Stackoverflow question regarding Subversion (SVN) vs Git:
… say you are a solo developer working on your own personal project. A centralized repository [SVN] might be an obvious choice but consider this scenario. You are away from network access (on a plane, at a park, etc) and want to work on your project. You have your local copy so you can do work fine but you really want to commit because you have finished one feature and want to move on to another, or you found a bug to fix or whatever. The point is that with a centralized repo you end up either mashing all the changes together and committing them in a non-logical changeset or you manually split them out later.
Another quote from http://hginit.com/top/ regarding distributed (Git/Mercurial) source control:
.. you can have a QA repository that lets the QA team try out the code. If it works, the QA team can push it up to the central repository, meaning, the central repository always has solid, tested code. And it works!
That means you can run experiments in separate repositories, and if they work, you can merge them into the main repository, and if they don’t work, you can abandon them, and it works!
What would I do?
From my current experience I’d choose either Git or Mercurial. Making merging a simpler task sounds like win-win from my point of view.
More on Distributed Version Control:
The Git vs Mercurial Debate:
Learning Mercurial (and an introduction to source control):
Other random tools I use that you may find useful
Twitter – http://www.twitter.com – not for celebs, for geeks! I only follow people who talk about the technology stuff I’m interested in. Try to find a twitter list of geeks
Balsamiq – http://www.balsamiq.com/ – Awesome prototyping tool. I think prototyping could be another post on its own.