Created
August 12, 2011 18:17
-
-
Save fapestniegd/1142619 to your computer and use it in GitHub Desktop.
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/bash | |
| # gitolite mirroring | |
| # please see doc/mirroring.mkd for instructions on how to use this | |
| # flush STDIN coming from git; we have no use for that info in this hook but | |
| # if you don't do this, git-shell sometimes dies of a signal 13 (SIGPIPE) | |
| [ -t 0 ] || cat >/dev/null | |
| 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 "cd $GL_REPO.git; git config receive.fsckObjects true" | |
| git push --mirror $mirror:$GL_REPO.git || | |
| echo "WARNING: mirror push to $mirror failed" | |
| fi | |
| done | |
| fi >&2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment