MicrolearnENPTES

Resolving a merge conflict

Lesson 13 of 24 · Git.Micro

When both branches changed the same lines, Git can't choose for you. It stops the merge, marks the conflict in the file and waits for you to decide.

The file shows both versions: yours between <<<<<<< HEAD and =======, theirs up to >>>>>>> branch.

Edit the file into its final form and delete the three marker lines.

Then git add the file to mark it resolved and git commit to finish the merge. git merge --abort cancels instead.

Type edit menu.txt (or tap the file in the Files panel) to open it in the editor.

Check yourself

What does git add mean during a merge conflict?

Merge shop into main. Both branches added a line to the menu: keep both Blog and Shop, then finish the merge.

menu.txt in main has “- Blog” and “- Shop”

Do it in the browser: a real Git tool, a short mission and instant feedback. No install.

Start this lesson — free
← Three-way mergesPick a side: --ours and --theirs →

All lessons · Git.Micro