resolving-merge-conflicts

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
  1. See the current state of the merge/rebase. Check git history, and the conflicting files.
  2. Find the primary sources for each conflict. Understand deeply why each change was made, and what the original intent was. Read the commit messages, check the PRs, check original issues/tickets.
  3. Resolve each hunk. Preserve both intents where possible. Where incompatible, pick the one matching the merge's stated goal and note the trade-off. Do not invent new behaviour. Always resolve; never
    --abort
    .
  4. Discover the project's automated checks and run them — typically typecheck, then tests, then format. Fix anything the merge broke.
  5. Finish the merge/rebase. Stage everything and commit. If rebasing, continue the rebase process until all commits are rebased.
  1. 查看合并/变基的当前状态。检查git历史记录,以及冲突文件。
  2. 找到每个冲突的主要来源。深入理解每个更改的原因,以及原始意图。阅读提交信息,查看PRs,检查原始问题/工单。
  3. 解决每个代码块的冲突。尽可能保留双方的意图。当意图不相容时,选择符合合并既定目标的方案,并记录权衡取舍。不要创造新的行为。务必解决冲突;绝不要使用
    --abort
  4. 了解项目的自动化检查并运行它们——通常是typecheck,然后是测试,再是代码格式化。修复合并导致的任何问题。
  5. 完成合并/变基。暂存所有内容并提交。如果是变基操作,继续变基过程直到所有提交都完成变基。