gitolite/hooks/common/post-receive.mirrorpush
2010-10-26 20:30:10 +05:30

23 lines
559 B
Bash
Executable file

#!/bin/bash
# gitolite mirroring
# please see doc/mirroring.mkd for instructions on how to use this
if [ -n "$GL_SLAVES" ]
then
for mirror in $GL_SLAVES
do
if git push --mirror $mirror:$GL_REPO.git
then
:
else
ssh $mirror mkdir -p $GL_REPO.git
ssh $mirror git init --bare $GL_REPO.git
ssh $mirror git config receive.fsckObjects true
git push --mirror $mirror:$GL_REPO.git ||
echo "WARNING: mirror push to $mirror failed"
fi
done
fi >&2