Skip to content

Instantly share code, notes, and snippets.

@martijnvermaat
Created February 1, 2012 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martijnvermaat/1717830 to your computer and use it in GitHub Desktop.
Save martijnvermaat/1717830 to your computer and use it in GitHub Desktop.
GitHub mirror of the LOVD3 Subversion repository

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment