Merge Conflicts

When working with Git, we will inevitably run into merge conflicts. Merge conflicts happen when there are conflicting changes to the same set of code in different branches. To resolve merge conflicts, we use tools to analyse the differences in the code and decide on what the code should look like after the merge.

Tools

Terminology

  • Base: the original version of the file before the conflicting changes were applied
  • Local/Current: the version of the file in the target branch
  • Remote/Incoming: the version of the file from the source branch
  • Output/Result: the merged version of the file
  • 2-way merge: the merge editor will allow you to merge Local and Remote into Output
  • 3-way merge: the merge editor will allow you to merge Base, Local and Remote into Output

Learn More