Skip to content

Automatic Updates

hilbix edited this page Feb 16, 2013 · 13 revisions

The automatic mirroring is done via https://github.com/hilbix/mirror2git/ now.

For the GIT sources which are mirrored please see "Sources" section of How to use.


Historic notes

If nothing breaks, one of my hosts essentially runs following each day now via CRON to keep this mirror here updated:

git checkout -q "`git rev-parse HEAD`"
git remote update --prune
git for-each-ref --shell --format='[ -z %(upstream:short) ] || git update-ref %(refname) %(upstream:short)' refs/heads | bash
git push --mirror origin

Note that I cannot use --mirror on the sources, as two repos shall be combined.

Explained:

  • First: Enter detached head state, such that the update-ref can be used safely while not loosing the current state I might be looking at
  • Second: Pull all remotes
  • Third: Move the refs (branches) to their tracking position. This works as we are in detached head state (see First:)
  • Last: Push this to GitHub

Notes:

  • Stopped working between 2012-11-14 and 2012-12-16 because I moved this to another machine and forgot to run it via cron
Clone this wiki locally