...

/

Resolving Merge Conflicts

Resolving Merge Conflicts

This lesson will teach you ways in which you can resolve merge conflicts.

In the previous lesson, we looked at how merge conflicts can occur and worked with an example to create a merge conflict. We made changes to the same file, file1.txt, in two different branches and tried to merge them. Git can’t decide on its own which change should remain so a developer would have to resolve the conflict themselves.

In the terminal below, we have a merge conflict that has taken place when we try to merge a branch called feature_branch with master.

Terminal 1
Terminal
Loading...

What to do when a merge conflict occurs

In the terminal provided above, our merge process was halted because of a conflict. We need to make sure that the conflict no longer exists so that the merge can be completed. ...