-
Look at the current state—what state the merge/rebase is in. Check the git history and conflicted files.
-
Find the primary source of each conflict. Deeply understand the reason and original intent behind each change. Read commit messages, look at PRs, look at the original issue/ticket.
-
Resolve conflict hunks one by one. Preserve both sides' intent whenever possible. If incompatible, choose the side consistent with the stated goal of the merge, and record the trade-off.Do notinvent new behavior. Always resolve, never
--abort。 -
Find the project'sautomated checksand run them—usually typecheck, then tests, then format. Fix anything the merge broke.
-
Finish the merge/rebase. Stage and commit all changes. If it is a rebase, keep going until all commits are rebased.
resolving-merge-conflicts
Coding & development
Updated 10-16 10:04