Leveraging Dropbox & GIT

03 Aug 2011

Recently I have been using GIT so much that I’ve been considering upgrading my Github account. The problem is, I don’t want to pay $7 a month for another service. Yes, yes I know Github is very super awesome and I should probably just pay for the service, BUT…why when you can make something similar using free services.

Now this obviously doesn’t have all the awesomeness that Github has, but if you want personal repositories and have a computer at home then you can do this.

  1. Get and install Dropbox if you have not already.
  2. Create a folder wherever you want in your Dropbox folder(I suggest in the root of your Dropbox) and name it GITREPOS. You can name it whatever you want, just remember the path.

Now, whenever you want a new repo you should make a bare one in your dropbox folder like so

git init –bare /<name of new git repo>.git</span>

Ok now you have a bare git repository sitting in your GITREPOS directory which is synced, backed up and all that Dropbox goodness, but how to get to it from another computer?

You can either install Dropbox on that computer which takes forever if you have a lot of stuff in your Dropbox account already. OR, you can use Dynamic DNS.

Setup DynDNS on whatever computer you want to do the GITREPO stuff on.

I actually set up DynDNS with 2 hosts.

  • One for my laptop
  • One for just my home network.

So I have a hostname for my laptop that points to it wherever my laptop goes and I also have one dedicated on my home network(I have DynDNS update my home network from my WRT54G. Make sure to forward Port 22 for ssh)

* Note: You can use whatever dynamic DNS service you want. I have just used DynDNS in the past so stuck with it.

You now have:

  • Dropbox syncing your GITREPOS to any computer you setup Dropbox on
  • Dynamic DNS hostname pointing to your computer with your GITREPOS

To complete your Jedi training you should also probably setup some SSH keys for your new host. I’m not going to go into details on that, but it is quite easy an there is a lot via a Google search about it.

Now that you have full Jedi powers you can do

git clone <my dyndnshost>:<path to git repo in my dropbox>

«« Previous Post Next Post »»