This documents how to setup and maintain a GitHub mirror of the official LOVD3 Subversion repository. It is synchronized automatically with the LOVD3 Subversion repository every hour. The mirror only contains SNV trunk (Git master branch), so no branches or tags.
The Git repository was setup using the following commands:
mkdir LOVD3.git
cd LOVD3.git
git init
git svn init -T https://humgenprojects.lumc.nl/svn/LOVD3/trunk
git svn fetch
git gc # to speed things up
git remote add origin git@githubmirror:martijnvermaat/LOVD3.git
It is synchronized hourly using the following commands:
git svn rebase
git push origin master
These commands are wrapped in a shell script which is executed from cron. For this to work, a passphrase-less deploy key should be setup for the repository.
ssh-keygen -t rsa -C 'LOVD3-github-mirror' -f ~/.ssh/id_rsa_lovd3_github
Put the following in ~/.ssh/config:
Host githubmirror
User git
Hostname github.com
IdentityFile /home/martijn/.ssh/id_rsa_lovd3_github
The cron entry can look something like:
# Sync LOVD3 GitHub mirror every hour
40 * * * * /home/martijn/LOVD3-github-mirror/LOVD3-github-sync.sh >> /var/log/sync-lovd3-github 2>&1
GitHub Issues are disabled since issues should be reported in the official LOVD3 Trac.
The method mainly follows this guide. An example of a more sophisticated mirror including tags and branches can be found here.