Skip to content

Instantly share code, notes, and snippets.

@rfreebern
Created October 3, 2011 19:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rfreebern/1260052 to your computer and use it in GitHub Desktop.
Save rfreebern/1260052 to your computer and use it in GitHub Desktop.
Use bitbucket as a private offsite code backup
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 git@bitbucket.org:username/project.git
and use this post-commit hook to silently and automatically push your changes up after each commit.
#!/bin/sh
BRANCH=`git branch --no-color | grep '*' | tr -d \*\ ;`
git push bitbucket $BRANCH &>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment