그냥 힘내의 repo (들)의 거울을하고 있다면, 당신은 다음과 같은 스크립트를 실행하는 cron 작업을 설정할 수 있습니다 : 이것은 당신이 SSH 키가 설치되어 가정
#!/bin/bash
USER=bitbucketuser
ERROR_FILE=clone_update_err
CLONES=/path/to/clones
cd $CLONES
if [ $# -ne 1 ]; then
for DIR in *; do
if [ -d $DIR ]; then
./update.sh $DIR 2> $ERROR_FILE
if [ -s $ERROR_FILE ]; then
echo $DIR >&2
cat -n $ERROR_FILE >&2
fi
fi
done
else
DIR=$1
echo $DIR
cd $DIR
if [ -a source ]; then
cd source
if [ -d .hg ]; then
hg pull
elif [ -d .git ]; then
git pull
elif [ -d .bzr ]; then
bzr pull
elif [ -d .svn ]; then
svn up
else
echo "$DIR is not a known repository type."
return 1
fi
cd ..
hg convert source hg
URL=ssh://[email protected]/$USER/$DIR/
cd hg
hg pull $URL
hg push $URL # You can add -f here if you don't mind multiple heads
cd ..
else
# hg dir or hg-git
cd hg
hg pull
hg push $URL
cd ..
fi
cd ..
sleep 5
fi
. 보시다시피, 다른 VCS도 미러링합니다. 그것은이 같은 디렉토리 구조를 가정
clones/
project1/
source/ # Original Git/Bazaar/SVN/Mercurial repo
hg/ # Mercurial repo
는 물론, 이것은 단지 하나의 방법이지만, 당신이 망할 놈의 모든 작업을 할 경우, 그것은 중요하지 않습니다.
hg-git는 양방향입니다. –
[Mercurial Repository와의 상호 운용성] (http://stackoverflow.com/questions/883452/git-interoperability-with-a-mercurial-repository) 중복 가능 – skolima