Revision Control and off Site Backups

Repository servers are a really great tool. When I was developing Caps N’ Coins I was doing it solo, so a repo server was actually unnecessary. However I still chose to use one. The one that I have the most experience with is Mercurial. Mercurial is a great tool, it is primarily a command line application but Graphical User Interfaces for it to exist. Mercurial also has plugins so that it can be integrated with other development environments like Eclipse.

Mercurial, like Git, is a distributed revision application, and I do not use it properly what so ever. Every time I have used it either with the development of Project Cumulus or Caps N’ Coins I have used it as if it were client / server. I have a linux server set up with mercurial running and I push and pull changes to the server, never from any of the other developers directly. I have always assumed that I would like Subversion

These tools are great and when working with a team of developers you really should look into using one of these tools. With Mercurial you are able to see all of the changes that everybody makes to the code with each push, see what changes cause branches and you are able to do all of this securely. Mercurial is able to send and receive data over ssh so that all code changes will be encrypted before they are transmitted. This is a great thing if you are worried about security, as I am. I also have my linux server set up to use 2 factor authentication and Mercurial still works with this.

Getting mercurial set up to use ssh on windows is actually pretty easy, you just need to install Open SSH on your windows computer and then you can use the command

hg push ssh://user@server.com//path/to/repo

to push the change. You will be prompted for the password to the username you provided and if 2 factor authentication is set up you will also be asked to provide the pin.

One of the best things you can do on top of using a revision control system is to also make sure that all of your code is backed up in multiple locations. Having access to all of the changes to your code, that you have ever made, is great; but, it doesn’t help you if your hard drive is damaged or stolen. All of your code could be completely lost and all of your hard work would be for nothing if that were to happen.

I got into the habit of keeping my Mercurial repository in multiple locations. I have the repo on whatever machine I am currently doing the development on, and the server that I normally push the changes to. On top of those locations I have also recently started storing the repository files in cloud storage services. The three that immediately come to mind would be Dropbox, Microsoft Onedrive, and Google Drive. All of these services offer you multiple gigabytes of storage for free if you sign up, and they have applications you can install on your computer. A folder labeled for the service will show up in your “My Documents” directory, and whatever files you put in there will be sent to the remote servers and then you instantly have an off site backup.

The great thing is if you are concerned about security, as I am, all three of these services support two factor authentication using either sms or using the Google Authenticator app available for iOS and Android (there is a Blackberry 10 version that I use as well called Authomator). Revision control combined with off site backups could potentially save all of your hard work, get into the habit of using both of these things, you will be glad you did.