← Module 08 · Development & Git
PART VIII · DEVELOPMENT & GIT

Conflict

A situation where Git cannot automatically decide how to combine overlapping changes.

01

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.

02

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.

03

What does it do?

Identify Conflicting Files
Compare Both Changes
Choose the Correct Result
Edit the File
Test the Result
Complete the Merge
04

Where is it used?

Merge
Rebase
Pull
Cherry-pick
Parallel Development
05

Example

Branch A

status = "Approved"

Branch B

status = "Confirmed"

Git cannot automatically know which change is correct.

06

How it connects

Different Branch Changes
Merge
Conflict
Manual Resolution
Test
Complete Merge
07

Do Not Confuse

Conflict

A version-control problem combining code changes.

Bug

A defect in software behavior.

08

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.冲突中另一个分支对应的修改版本。
09

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

↑