Last Updated: February 25, 2016
·
516
· hampuspersson

Git + Dropbox = VC for the cheap

I hope that you're using version control for you work! And I hope that your vc is git, it is simply the best. Anyways, the other day me and I friend of mine were starting up a small project of ours and were talking about if we should put it on Github or in Bitbucket when a thought struck me - why not use the Dropbox-folder that we already shared for other resources to share our .git too. And a few minutes later our completely private git repo was up and running, LAN sync and all. I know, might not be the most useful of protips, but it worked out well for us so I figured someone else might be able to draw some knowledge from it too.

Here's my Dropbox git repo, in all it's glory:

1. Create git project

~/project $ git init
~/project $ git add .
~/project $ git commit -m "Initial commit"

2. Create git repo

~/project $ cd ~/Dropbox/git
~/Dropbox/git $ mkdir project.git
~/Dropbox/git $ cd project.git
~/Dropbox/git/project.git $ git init --bare

3. Push to your new remote

~/Dropbox/git/project.git $ cd ~/project
~/project $ git remote add origin ~/Dropbox/git/project.git
~/project $ push origin master

Done. Give it a second or two to sync and then you're ready to pull it to your other computers.