Thursday, February 24, 2011

[How to] Setup a Personal Project Repository for free

If you are working on an open source project, there are many places where you can host your project. Some of the popular ones are Google Code, Github, etc. Google Code includes SVN and Mercurical as SCM system. However, if you are working on a personal project and don’t want to open your code yet, there are very limited options left for you. One of the popular free hosts is Beanstalk which offers you 100 MB space, 1 user and 1 repository. Github offers private repository but its little expensive. Here is a tip for you to setup your private repository using free cloud-based file hosting services like Dropbox, SugarSync, etc. Note: I will be using SVN for explanation in this post. You can use any versioning system of your choice.

Personal Project Repository on the Cloud

Setup private repository on the cloud

  • Create your SugarSync account. Setup an account with Dropbox or SugarSync (Referral links). Dropbox offers 2 GB free storage where as SugarSync provides 5 GB and you can sync multiple folders with SugarSync. The rest of this post assumes that you have a SugarSync account and have installed SugarSync desktop application. Note: Both Dropbox and SugarSync have their in-built versioning system but you can not enjoy all the features of an SCM like branching, merging, etc.
  • Creating the repository. Create a folder named “Repositories/<your_repo_name>” within your synced folder. Then, create a SVN local repository in the same folder. You can use any of the SVN clients to do this. I have used TortoiseSVN to create repository.
  • Committing the code. Now that the local repository is ready, you can start committing the code / any file to the repository just like any other repository. The only difference will be accessing the repository via file:// protocol. As you commit the files, the repository will be synced on the cloud. It is important to understand that only the committed files will be synced on the cloud.
  • Syncing Work / Home setup. If you are working on multiple computers, you can setup SugarSync / Dropbox sync from all the machines. If you commit on one computer and then commit on another before SugarSync/ Dropbox has synced the files, you may end up with a corrupted repository. To maintain the sanity of the repository, please ensure that the files are synced before committing the files. 
  • Team Collaboration.  There are two options for you to collaborate with your team. Frist and the simplest one is to share the repository folder in Windows. Your peers can also access the shared repository via file:// protocol. The second option is to setup a local SVN server using tools like VisualSVN Server. This will help you setup a repository as well as providing HTTP access to your repository. There is also a third option but I don’t recommend using that. You can share the repository as a folder on SugarSync / Dropbox. Your peers will be able to sync the folders locally and commit the changes to their repository and it will be synced on the cloud. Be aware that using this method may corrupt your repository.

-- Varun

No comments:

Post a Comment

google-site-verification: googlea4d68ed16ed2eea6.html