w-git-repair

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Help with conflicts, detached HEAD, upstream divergence, and similar local Git problems. Follow git publish. Do not rewrite published history unless the user asked.
  1. Inspect
    git status
    ,
    git branch -vv
    , and the relevant log. State the current problem in one sentence.
  2. Propose the smallest safe commands. Explain what they change. Require explicit confirmation before commands that can discard local changes (
    git reset --hard
    ,
    git clean
    ,
    git restore
    ). Require an explicit user request before history-rewriting commands (
    git rebase
    ,
    git commit --amend
    of a published commit).
  3. After an authorized command, re-inspect status and remaining conflicts. Never force-push or bypass hooks.
帮助处理冲突、分离头指针(detached HEAD)、上游分叉以及类似的本地 Git 问题。请遵循 git publish。除非用户明确要求,否则不要重写已发布的历史记录。
  1. 检查
    git status
    、
    git branch -vv
    和相关日志。用一句话说明当前问题。
  2. 提出最小且安全的命令。解释这些命令会改变什么。在执行可能丢弃本地改动的命令(
    git reset --hard
    、
    git clean
    、
    git restore
    )之前,必须获得明确确认。在执行重写历史的命令(
    git rebase
    、修改已发布提交的
    git commit --amend
    )之前,必须得到用户的明确要求。
  3. 执行获得授权的命令后,重新检查状态和剩余冲突。绝不强制推送(force-push)或绕过钩子(hooks)。