Greetings!

The main purpose of this website is to support Android indie game developers with tutorials, reviews and promotion of their games. The main difficulty for the developers is not to make the game, but to get exposure. To get it out there. If you find anything useful here, please spread the word. Like my page on Facebook, follow me on Google+ or Twitter. Thank you!

Google+ Facebook Twitter

× close

Wednesday 12 February 2014

Poor Man's Source Code Backup and Version Control

This article will give you a simple tip how to backup your codes in a cloud and use version control at the same time and completely for free. This option uses Git that is included in Eclipse bundled with Android Development Tools and Dropbox.

Code backup

You are probably doing this already. One of the possibilities is to use a cloud storage service. You can use Google Drive or Dropbox, which is my favourite. If you don't have a Dropbox account, get one (this is a referral link. If you use it, we both get extra 500MB of space to use) and install Dropbox.

You can simply put your workspace or your project directory inside Dropbox (symbolic links work too).  Each change is automatically synced with Dropbox server. As a bonus you have your codes available from anywhere.

Version control system

VCS is used to track the history of changes and it helps when more people collaborate. There are many popular VCS such as CSV, SVN and Git. We are going to use Git - if you are using the Eclipse bundled with ADT, you already have Git!

There are version control hostings available, for example GitHub. They have advantages and disadvantages (such as paid private repositories). It's up to you what you prefer. This guide uses local Git inside Dropbox.

Git + Dropbox

First create a directory called "git" in your Dropbox folder. Create a new Android application project in that directory.




Next right click on the project and select Team -> Share Project. You will see the Git dialog. Check the "Use or create repository in parent folder of project", then select the project, click on the "Create Repository" and "Finish".



When you work with any VCS, you have to identify yourself. See the settings in Git preferences. And that's it. Now you can commit your codes to Git and all your data will be saved on your local machine and Dropbox servers, including the Git metadata.



When you setup the project location and git this way, both the codes and the Git metadata will be saved in Dropbox. For more information how to use Git in Eclipse, see this tutorial.
Martin Varga is a Czech software developer who likes pygmy owls (hence Kulíš), running, ramen, travelling and living in foreign countries. He is also known as smartus or sm4 on the internet (read as smartass, but there are too many of them). He currently tries to make games in AndEngine like Mr. Dandelion's Adventures and hangs around a lot at the AndEngine forums.