Two way git mirror: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>Hendrik Brummermann
Created page with "== Motivation == == Setup == == Mirror == We use the following script to do the actually mirroring. It can be invoked with the name of a known repository as parameter or wi..."
imported>Hendrik Brummermann
No edit summary
Line 1: Line 1:
{{TODO|introduction}}

== Motivation ==
== Motivation ==

{{TODO|motivation}}



== Setup ==
== Setup ==


We create a clone from either of the upstream repositories. It is important that the repository is bare.
== Mirror ==

<source lang="bash">
cd /srv/gitsync
git clone -bare git@github.com:[account]/[repository].git
mv [repository].git [repository]
</source>

Now we delete remote "origin" and configure a remote setting for each upstream repository instead:
<source lang="bash">
cd [repository]
git remote remove origin
git remote add github git@github.com:[account]/[repository].git
git remote add sourceforge ssh://[account]@git.code.sf.net/p/[repository]/code
</source>

{{TODO|Setup webhook at github and sourceforge}}


== Mirror scripts ==


We use the following script to do the actually mirroring. It can be invoked with the name of a known repository as parameter or with the "--all" flag.
We use the following script to do the actually mirroring. It can be invoked with the name of a known repository as parameter or with the "--all" flag.
Line 72: Line 96:


== Deleting branches ==
== Deleting branches ==

{{TODO|deleting branches}}