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