Git Team Development Process Specification - MR Conflict Resolution
·
1 min read
Recently, our frontend team encountered multiple code loss issues during code merging. Based on this phenomenon, we conducted analysis and finally established a conflict resolution process.
Conflict Resolution Process
Example
A conflict occurs between feat/xxx and sprint.
- Create a new conflict resolution branch called
resolve-conflict
- the name indicates it’s for handling conflicts, making it easier to trace later. Point thefeat/xxx
MR toresolve-conflict
- All relevant parties for the conflicting code work together to resolve the conflict
- Merge the
resolve-conflict
branch intosprint
, then deleteresolve-conflict
Principles
MRs that aren’t very urgent should be handled collectively. When conflicts occur, all relevant parties should review and handle them together to avoid code loss.
Why This Approach
- Handling conflicts locally: For protected branches, we don’t want to allow direct pushes. Creating a new branch can bypass this issue
- If conflicts are resolved directly in sprint, there’s a risk of encountering new node conflicts during submission, requiring additional conflict resolution. This makes the entire git history difficult to understand and not conducive to later problem tracing