Git + Dropbox, The Easy Way

There seems to be a lot of differing opinions out there on how best to handle git + dropbox.

My solution, is to keep it simple. Store git bundles in dropbox.

Further, I’ve added a hook for post-commit to dump the bundle right into dropbox. This way, I a) force myself to commit more because I can’t lazily rely on dropbox syncing all saved files and b) assure that my files–nay, the whole repository!–is backed up into the cloud.

My .git/hooks/post-commit file looks like this:

#!/bin/sh
cd ~/Documents/Code/BeerProject  
git bundle create ~/Dropbox/GitBundles/BeerProject.git.bundle master  

And that’s what I call, The Easy Way.