Two way git mirror: Difference between revisions

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:
{{TODO|introduction}}
 
== Motivation ==
 
{{TODO|motivation}}
 
 
== 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.
Line 72 ⟶ 96:
 
== Deleting branches ==
 
{{TODO|deleting branches}}