Git + Dropbox: the workflow of champions
I’ve been using this setup for some time now and it’s so insanely useful it’d be a shame if I didn’t share it. (Note: this isn’t new.) Basically, I use Git for my source control and Dropbox as my online repository—and it’s a snap to set up.
- Create a directory in your Dropbox folder for your projects. Mine’s called “Projects.”
- Open up a terminal and go to the directory of the project you’d like to host on Dropbox.
- In the terminal type:
git clone --bare . ~/Dropbox/[projects folder]/[project name].git - Then type:
git remote add [project name] ~/Dropbox/[projects folder]/[project name].git
That’s it! Now after every local commit, you can push your changes to Dropbox by doing git push [project name] master.
When I want to work on a project on my laptop, I run git clone ~/Dropbox/[projects folder]/[project name].git once to grab the initial code and git pull origin master everytime I want to pull new changes in.