diff options
| author | Arseney300 <Arseney300@gmail.com> | 2026-02-20 11:41:28 +0700 |
|---|---|---|
| committer | Arseney300 <Arseney300@gmail.com> | 2026-02-20 11:41:28 +0700 |
| commit | 4a754b397f887479398ea9e58aa19368ef8e9f8b (patch) | |
| tree | 122a17141f69b78ab1d6da8e422b72d38d9c4c6c /doc/setup-guide.md | |
| parent | e89d1fe02c35a6b7f6ece38e3aa5fa20a8737a04 (diff) | |
Add importing existing repositories to setup guide
Cover bare clone for one-time copies and mirror clone for keeping
repos synced with an upstream source.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'doc/setup-guide.md')
| -rw-r--r-- | doc/setup-guide.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/setup-guide.md b/doc/setup-guide.md index 295450c..6dc8d44 100644 --- a/doc/setup-guide.md +++ b/doc/setup-guide.md @@ -111,6 +111,36 @@ or git clone git://<server-ip>/test.git ``` +### 4.4 Import an existing repository + +To make a one-time copy of an existing repository (e.g., from GitHub): + +```bash +cd /var/git/repos +git clone --bare https://github.com/user/repo.git +chown -R 1000:1000 repo.git +``` + +This copies all branches, tags, and history. The remote reference is removed, +so it becomes a standalone copy with no link back to the original. + +To keep syncing from the original source, use `--mirror` instead: + +```bash +cd /var/git/repos +git clone --mirror https://github.com/user/repo.git +chown -R 1000:1000 repo.git +``` + +This keeps the remote configured so you can periodically pull updates: + +```bash +cd /var/git/repos/repo.git +git remote update +``` + +`--mirror` syncs all refs exactly, including deleted branches. + ## 5. Ghost (Blog) |
