How to Set Up a Git Repo on Dropbox
Last weekend, I was finally able to persuade my co-worker to join me in a hackathon. It is an annual event where a herd of passionate coders gather together and hack away any projects (web/mobile/hardware) in a timeframe of 2 days to compete for prizes, glories, and/or VC’s/angel investors’/employers’ attention. The only requirement is that the project has to be within Hollywood theme — media and entertainment. Being hosted for the 2nd time, it already attracted a lot more developers/sponsors and had a better location than last year. Our project was PlayFrame — a simple Twitter meets online presentation to display concise messages.
Anyways, my team was discussing about how to collaborate and set up our development environment. Some obvious options comes to mind: Github and Beanstalk. However, we wanted to try something different this time. Being Dropbox addicts, we tried to figure out how to set up a Git repository on it (from my awesome co-worker/teammate’s idea). After all, Dropbox is amazing with syncing files, which makes it ideal for this purpose. Here are the steps of how we did it and you can replicate them easily:
Set up a Git Repo on Dropbox
- Go to your dropbox shared folder ~/Dropbox/projects/
- Make a new git repo directory ex. > mkdir project1.git
- Create a blank repo ex. > cd project1.git; git init –bare;
- Now you can clone the directory and share it with your teammate
Clone the git repo and ready for development
- Go to your favorite project directory ex. ~/projects
- Clone one of the git projects in this directory. ex. git clone ~/Dropbox/projects/projectx.git
- Now you can edit, commit and push the files back to the shared directory.
Do a git push and wait for the Dropbox icon to sync. On the other hand, if you see your Dropbox signals a new sync, you know it’s time to do a git pull
That’s it! You officially have a private Git repository that can be collaborated by as many developers as you wish to share with.