#!/bin/bash # To backup a git repository, copy only the .git dir and not the # working tree. We don't simply use push/pull since we want to be # able to do local rebases. [ -z "$2" ] && echo "usage: $0 " && exit 1 REPO_DIR=$1 REMOTE_PATH=$2 REPO_BASE=`basename $1` exec rsync.clone $REPO_DIR/.git/ $REMOTE_PATH/$REPO_BASE.git