resolving-merge-conflicts
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese-
查看当前 merge/rebase 状态。检查 git history 和冲突文件。
-
为每个冲突找到 primary sources。深入理解每个变更为什么产生,以及原始意图是什么。阅读 commit messages,检查 PRs,检查原始 issues/tickets。
-
解决每个 hunk。 尽可能保留双方意图。若二者不兼容,选择符合本次 merge 目标的一方,并记录 trade-off。不要发明新行为。始终解决冲突;不要。
--abort -
发现项目的 automated checks 并运行它们,通常是 typecheck、tests、format。修复 merge 引入的问题。
-
完成 merge/rebase。 Stage 所有内容并 commit。若正在 rebase,继续 rebase 流程直到所有 commits 都完成。
-
Check the current merge/rebase status. Review the git history and conflicted files.
-
Identify the primary sources for each conflict. Gain a deep understanding of why each change was made and what the original intent was. Read commit messages, check PRs, and review original issues/tickets.
-
Resolve each hunk. Preserve the intent of both parties as much as possible. If they are incompatible, choose the one that aligns with the goal of this merge and document the trade-off. Do not invent new behaviors. Always resolve conflicts; do not use.
--abort -
Locate the project's automated checks and run them, typically including typechecks, tests, and formatting. Fix any issues introduced by the merge.
-
Complete the merge/rebase. Stage all changes and commit. If rebasing, continue the rebase process until all commits are completed.