Skip to content

Instantly share code, notes, and snippets.

@sfate
Forked from aslakhellesoy/gitbox.sh
Created June 1, 2012 11:02
Show Gist options
  • Save sfate/2851218 to your computer and use it in GitHub Desktop.
Save sfate/2851218 to your computer and use it in GitHub Desktop.
Set up a git remote in your DropBox Public folder
#!/bin/bash
# Call this script from a local git repo to set up a dropbox remote you can push and pull to
# I keep this script under ~/Dropbox/Public/.git/gitbox.sh
# Inspired from http://stackoverflow.com/questions/1960799/using-gitdropbox-together-effectively
PROJECT=$(basename `pwd`)
DROPBOX="$HOME/Dropbox/Public"
mkdir -p $DROPBOX/.git
pushd $DROPBOX/.git
git init --bare $PROJECT.git
popd
git remote add origin "$DROPBOX/.git/$PROJECT.git"
echo "*.swp" > .gitignore
git add . ; git commit -m "init"
git push -u origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment