Yo Dawg I Herd U Like Git and Dropbox, So I Made Git-dropbox So U Can Git While U Dropbox

- - posted in projectsopen-source

In a fit of random productivity this afternoon, I decided to codify my usage of Dropbox to host Git repos into a convenient shell script that people can use for their own projects. I like to host some git repos on Dropbox by having a folder full of bare repos in my Dropbox folder. It’s a pretty lightweight and easy way to have a remote for your project that asynchronously uploads itself to the cloud. Most people I know who like Git also like Dropbox, so I made git-dropbox so that they could git while they dropbox. Here’s my shell session while using git-dropbox to create the dropbox git repo for git-dropbox (that’s right):

    + [17:52:03](max@lola)(git-dropbox) -> git dropbox create git-dropbox 
    Initialized empty Git repository in /Users/max/Dropbox/git/git-dropbox.git/
    + [17:52:23](max@lola)(git-dropbox) -> git remote add dropbox ~/Dropbox/git/git-dropbox.git
    + [17:52:40](max@lola)(git-dropbox) -> git push dropbox 
    Counting objects: 21, done.
    Delta compression using up to 8 threads.
    Compressing objects: 100% (17/17), done.
    Writing objects: 100% (21/21), 3.24 KiB | 0 bytes/s, done.
    Total 21 (delta 4), reused 0 (delta 0)
    To /Users/max/Dropbox/git/git-dropbox.git
     * [new branch]      master -> master

And that’s pretty much all there is to it. The git dropbox clone command is provided as well as a convenience. If you wish to name your local working directory something other than the same name as the git repo (without the .git at the end), then you’ll have to use git clone like everybody else. Let that be a lesson to the kids out there: name your repos well.

With that in mind I’m going to engage in a little more hackery before my night is done. Enjoy the pleasant weather this weekend, space cadets; it will not last us long.