[Just leaving this here for my own reference.]
I liked git bundle
and it answered the question. However, it's slow and the bundle is big. using zip
is slow and the bundle is small.
In the end, I decided to go with Pat Notz's answer. So it looks like this:
Setup a Bare Repo
mkdir /myBareRepo.git
cd /myBareRepo.git
git init --bare
Push to the Bare Repo
git push --mirror /myBareRepo.git
Make an Alias
git config --add alias.backup "push --mirror /myBareRepo.git"
Use The Alias Intead of the Push Above
git backup
However I think the aliases are system-wide, so a name like "backup" would be bad news. Not sure yet. (This is wrong! If you don't use --global
you're fine.)
Edit: Using this solution with a DropBox has to be the cheapest way to get a small repository backed up all the time... you could probably even share it. Although http://www.indefero.net/plans/ looks cheap too. Hmm...