Conflict
A situation where Git cannot automatically decide how to combine overlapping changes.
What is it?
A merge conflict happens when Git cannot automatically combine changes from different branches.
This often occurs when the same part of a file was changed in incompatible ways.
Simple Definition: A conflict means Git needs a person to decide which code should remain.
Think of it like...
Think of two people editing the same sentence differently.
A tool cannot safely guess which version is correct.
A person must decide.
What does it do?
Where is it used?
Example
status = "Approved"
status = "Confirmed"
Git cannot automatically know which change is correct.
How it connects
Do Not Confuse
A version-control problem combining code changes.
A defect in software behavior.
Topic Glossary
| Term | 中文 | Definition | 中文解释 |
|---|---|---|---|
| Conflict | 冲突 | A situation where Git cannot automatically combine changes. | Git 无法自动判断不同代码修改应该如何合并的情况。 |
| Merge Conflict | 合并冲突 | A conflict that happens while merging branches. | 两个分支合并时产生的代码冲突。 |
| Conflict Marker | 冲突标记 | Text Git inserts to show conflicting sections. | Git 在文件中标记不同修改版本时加入的特殊符号。 |
| Resolve | 解决冲突 | Manually choosing and editing the final code. | 开发人员手动决定冲突部分最终应该保留什么代码。 |
| Ours | 当前分支版本 | The version from the current side of a conflict. | 冲突中当前所在分支对应的修改版本。 |
| Theirs | 另一分支版本 | The version from the other side of a conflict. | 冲突中另一个分支对应的修改版本。 |
What to Remember
Conflicts happen when Git cannot combine changes automatically.
Developers must inspect and resolve the final code.
Resolved code should be tested before completion.
Merge → Conflict → Resolve → Test