Skip to content

Instantly share code, notes, and snippets.

@mdp
Created May 21, 2015 23:07
Show Gist options
  • Save mdp/7f23aba9844ee3bb991e to your computer and use it in GitHub Desktop.
Save mdp/7f23aba9844ee3bb991e to your computer and use it in GitHub Desktop.
Backup your git based projects on Dropbox
#!/bin/bash
projectName=${PWD##*/} # Basename of current dir
gitRemote=~/Dropbox/src/${projectName}.git
echo "Creating bare repo in ${gitRemote}"
git init --bare ${gitRemote}
echo "Adding new remote 'dropbox'"
git remote add dropbox ${gitRemote}
git remote -v
echo "Pushing 'master' to 'dropbox'"
git push dropbox master
echo "done"
@dylanharrington
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment