How Does Conflict Exist?

Learn how conflicts can occur while merging branches.

New Git learners often worry about conflicts. If we plan our branches carefully, the conflicts are usually not difficult to fix.

Merge different branches versus fast-forward

Conflict exists when we merge two branches that edit the same line of the source file or if a file is deleted in one branch but its contents are updated in another. Conflicts don’t happen when the merge is fast-forwarding. It may occur when the git merge merges two different branches, but Git doesn’t know which change it should keep and which one it should discard.

Get hands-on with 1200+ tech skills courses.