README.markdown

What's This?

I've got a few git repos places I automatically clone git repos and
wanted to make sure these things stay up-to-date. Some repos are on
github, some are on other machines around the internet. They all look
the same here.

gitmirror updates git repositories on webhook triggers. This can be
anything from a simple invocation of curl from a post-commit hook to
github's post-receive hooks.

How Do I Use This?

Setting Up a Repo Path

First, you'll need stuff for it to do. Let's say we wanted to set up
a repository mirror location in /tmp/gitmirrors and our first mirror
will be of my awesome gitmirror project.

First, install the software:

go get github.com/dustin/gitmirror

Now, create a location for your mirrors and (as an example), check out
the gitmirror source into it:

But I Don't Have a Public Address

Hooks

gitmirror will run post-fetch hooks for you if you have them
available. One or both of the following will be executed (in this
order):

$gitmirrordir/current_repo.git/hooks/post-fetch

$gitmirrordir/bin/post-fetch

The first is the repository specific hook, allowing you to do stuff
like CI integration or doc builds or something.

The second is a single global hook that will run for every repo
allowing you to have a common behavior across all updates (e.g. you
might want to touch 'git-daemon-export-ok' or post something to
twitter or chain a different hook or something.

Batches of Hooks

If you have a ton of hooks to set up, check out the
setuphooks command. It works great for hundreds of
repos with simple patterns to express how you want them to map to your
mirror.