-
-
Save vrillusions/1572287 to your computer and use it in GitHub Desktop.
Use bitbucket as a private offsite code backup (edited)
This file contains hidden or 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
Now that bitbucket supports git, it's easy to use their service as a free, private, offsite code backup. Just create an empty repo for your project on bitbucket, add it as a remote to your development repo: | |
username@host:~/project$ git remote add bitbucket [email protected]:username/project.git | |
Edit: I had to change in the config file the url value to set the complete https url: https://[email protected]/username/project.git | |
and use this post-commit hook to silently and automatically push your changes up after each commit. |
This file contains hidden or 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 | |
BRANCH=`git branch --no-color | grep '*' | tr -d \*\ ;` | |
# The mirror option will automatically push all branches (even ones not pushed to github) | |
# WARNING: haven't actually tested this so $BRANCH may not be necessary | |
git push --mirror bitbucket $BRANCH &>/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment