LoginSignup
9
9

More than 5 years have passed since last update.

GitHubリポジトリのミラー

Posted at

GitHubというかGHEの同期の方法です.

GHEのインストールされてるホストghe1,ghe2があるとします.
常にghe1からghe2へミラーを送る手順を説明します.

事前準備

まずローカルにghe1のミラーを作成と
リモートリポジトリにghe2を追加します.

git clone --bare git@ghe1:foo/bar.git
cd web.git/
git remote add ghe2 git@ghe2:foo/bar.git

同期

同期方法はgit-fetchoriginghe1の変更を取り込みます.

次にgit-pushghe2へ向けてpushします.

以上終わり.

git fetch --prune origin 'refs/heads/*:refs/heads/*'
git push ghe2 --mirror

参考

9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9