Last Updated: February 25, 2016
·
1.367K
· _jeffreyjackson

git on Dropbox!

Assumptions:
1. Repositories is a folder on dropbox with your repositories
2. MyProject.git is the project's repository
3. You have the Dropbox app installed
4. You're on a Mac.

Create the git repository in Dropbox using Terminal

cd ~/Dropbox
mkdir Repositories/MyProject.git
git init --bare Repositories/MyProject.git

Now that the Repository is created, you can push the project in. If you already have a local git repo for your project start at line "git add ."

cd ~/Projects/ProjectFolder
git init .
git add .
git commit --all -m "Initial commit"
git remote add dropbox /Users/_jeffreyjackson/Dropbox/Repositories/MyProject/
git push dropbox master

Blamo.

Now the fun part. Pulling to a different machine:

cd ~/Projects
git clone -o dropbox /Users/_anotherdeveloper/Dropbox/Repositories/MyProject/

Pushing back to the Remote Repository:

git commit --all -m "Updated Source Code!"
git push dropbox master

Syncing with the master:

git pull dropbox master