From 03f95ece09f7ec0654b1f0e0ba7361636d61f894 Mon Sep 17 00:00:00 2001 From: sparrowren <136441924+sparrowren@users.noreply.github.com> Date: Thu, 15 Oct 2026 10:21:08 +0800 Subject: [PATCH] docs: fix fork synchronization instructions --- README.md | 17 ++++++++++++----- README_zh.md | 17 ++++++++++++----- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 93605abb..a675f8fe 100644 --- a/README.md +++ b/README.md @@ -16,18 +16,25 @@ If you have any comments or suggestions about the documentation, please submit t (1) Download the Asciidoc or Typora document editor. -(2) Check if the upstream repository has updates. If so, please sync to your own fork first: +(2) Before contributing, sync your fork with the upstream repository. In your local clone of your fork, check the configured remotes: +```sh +git remote -v ``` -git remote -git fetch upstream +If `upstream` is missing, add it once with `git remote add upstream https://github.com/IvorySQL/ivorysql_docs.git`. -git merge upstream/main +Commit or stash any local changes before switching branches. The following example syncs the local `v5.6` branch; replace `v5.6` throughout with the branch you intend to contribute to: -git push +```sh +git fetch upstream +git switch v5.6 +git merge --ff-only upstream/v5.6 +git push origin v5.6 ``` +If the fast-forward merge fails because the branches have diverged, resolve the divergence before pushing. + (3) Familiarize yourself with the [Writing Guidelines](#writing-guidelines). ## Contribution Scope diff --git a/README_zh.md b/README_zh.md index 4301e8a9..f0a0f2f9 100644 --- a/README_zh.md +++ b/README_zh.md @@ -15,18 +15,25 @@ (1)下载Asciidoc或者Typora文档编辑器。 -(2)检查源仓库是否有更新,如果有更新请先更新并同步到自己的仓库。如有更新请参阅以下步骤,更新至最新版本: +(2)贡献前,请先将自己的 fork 与上游仓库同步。在自己 fork 的本地克隆目录中,检查已配置的远程仓库: +```sh +git remote -v ``` -git remote -git fetch upstream +如果尚未配置 `upstream`,请先执行一次 `git remote add upstream https://github.com/IvorySQL/ivorysql_docs.git`。 -git merge upstream/main +切换分支前,请先提交本地修改,或使用 `git stash` 临时保存。以下示例同步本地的 `v5.6` 分支;如果要向其他分支贡献,请将所有 `v5.6` 替换为相应的分支名: -git push +```sh +git fetch upstream +git switch v5.6 +git merge --ff-only upstream/v5.6 +git push origin v5.6 ``` +如果分支历史已分叉,导致无法快进合并,请先处理分叉,再推送。 + (3)熟悉[文档写作规范](#规范说明) ## 贡献范围