Created
May 21, 2015 23:07
-
-
Save mdp/7f23aba9844ee3bb991e to your computer and use it in GitHub Desktop.
Backup your git based projects on Dropbox
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/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" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/anishathalye/git-remote-dropbox