16. A conflict is two changes to the same lines
When both sides changed the same lines Git stops, writes both versions between markers, and waits; you edit, add to mark resolved, and commit to finish the merge.

16. A conflict is two changes to the same lines

When both sides changed the same lines Git stops, writes both versions between markers, and waits; you edit, add to mark resolved, and commit to finish the merge.

Conflicts are routine and mechanical once you know Git is asking a question, not reporting a failure.

A merge applies two sets of changes. Usually they touch different lines. Git applies both.

Sometimes both sides changed the same lines. Git has no rule for picking one.

So it stops. It writes both versions into the file, between markers. And it waits.

You edit the file until it says what you want. Then git add. That marks it resolved.

Then git commit finishes the merge. A conflict is not an error. It is a question only you can answer.

Check yourself. What does git add do during a conflicted merge?

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

Attributes
name
16. A conflict is two changes to the same lines
summary
When both sides changed the same lines Git stops, writes both versions between markers, and waits; you edit, add to mark resolved, and commit to finish the merge.