Created
August 13, 2012 12:25
-
-
Save stinoga/3340157 to your computer and use it in GitHub Desktop.
Use Dropbox as a git repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This hook is used to push a mirrored version of all committed files to your dropbox repo after they are commited (optional) | |
# Replace this variable with your remote repo name | |
REPO=dropbox | |
echo | |
echo "==== Sending changes to $REPO repo ====" | |
echo | |
git push --mirror $REPO; | |
echo | |
echo "==== Donezo ====" | |
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make the repo folder in Dropbox | |
cd ~/Dropbox | |
mkdir gitRepos | |
# Create the git repo (replace repoName with whatever you want to name it) | |
mkdir repoName.git | |
cd repoName.git | |
git --bare init | |
# Add new remote to your git repo named dropbox | |
cd ~/Sites/repoName | |
git remote add dropbox file:///$HOME/Dropbox/gitRepos/repoName.git | |
git push dropbox master | |
# You can clone the repo on another machine like so | |
# This will also create a dropbox remote for this new clone | |
git clone -o dropbox file:///$HOME/Dropbox/gitRepos/repoName.git | |
# pulling from the repo on another machine | |
git pull dropbox <branchName> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment