How to use Dropbox as an SVN repository
Recently, the popular Cloud based startup Dropbox is getting lot of attention on Internet. It is a free file synchronization/backup service where you can backup, save and share files. Dropbox gives 2 GB of free space to every user where one can save / backup their files.
One of the interesting usage of Dropbox can be to use it as Subversion Repository to store your projects. We can create a local SVN repository on Dropbox which can be synchronized on Cloud by Dropbox. You can checkout this repository and add your projects / files into it. This way you can access your project anywhere. Also it is possible to share your repository with other users if you want to. Simply by sharing Dropbox folder where you have stored subversion repository can enables you to share it with other users.
Here is an example of hosting a local SVN repository on Dropbox.
Step 1: Create Dropbox repository
cd ~Dropbox
mkdir SVNRepository
cd SVNRepository
If you are using subversion command line utilities in Windows or using Unix box, we can create a new subversion repository by using
svnadmin
.svnadmin create .
If you are using TortoiseSVN client then you may want to create repository using following:
Right-click on the newly created folder SVNRepository and select TortoiseSVN → Create Repository here….
Right-click on the newly created folder SVNRepository and select TortoiseSVN → Create Repository here….
We just created a Subversion repository on top of Dropbox folder. Don’t edit those files yourself!!. If you get any errors make sure that the folder is empty and not write protected.
Step 2: Checkout Dropbox repository
Our Dropbox repository is ready and we can do checkin / checkout in this now. Before we add any project / files in this repository, we need to make sure we add proper directory structure in this SVN repository. It is a good practice to divide an SVN repositories in three directory: trunk, branches and tags.
First create a working folder where you want to checkout your SVN repository.
mkdir ~MyWorkspace
cd MyWorkspace
svn checkout file:///~Dropbox/SVNRepository
This will checkout the newly created repository in folder MyWorkspace.
Now create 3 directories in MyWorkspace: trunk, branches and tags and commit the change back to repository.
mkdir trunk
mkdir branches
mkdir tags
svn commit -m "Initial setup (committing trunk, branches, tags)"
Step 3: Checkout Trunk of Dropbox SVN repository
We are done with the setup.. Just checkout the Trunk of this newly created SVN repository and start committing your changes.
svn checkout file:///~Dropbox/SVNRepository/trunk
That’s it. Now you can checkout the SVN repository “file:///~Dropbox/SVNRepository/trunk” anywhere and commit your changes to it. Ofcourse this is now hosted on Dropbox so you can easily synchronize your changes between different computers. You can also share this repository with other Dropbox users letting them SVN your repository access
No comments: