summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/setup-guide.md30
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)