Skip to main content
  1. Learn center
  2. Software Development
  3. Guides
  4. Git tutorial
  5. Git basics
  6. Syncing repositories
  7. Resolving merge conflicts
GuidesSoftware DevelopmentBacklog
Git

Project and code management together.

Resolving merge conflicts

You may come across a conflict that needs resolving before you can properly complete a merge. For example, if two or more members make changes on the same part of a file in two different branches (i.e., remote and local branches), Git cannot merge them automatically.

Git adds conflict-resolution markers to the conflicting file when this happens. The markers help you figure out which sections of the file need to be resolved manually.

Diagram of a merging change.
Example of a conflict occurrence.

In our example above, everything above ===== is your local content, and everything below comes from the remote branch.

You must resolve the conflicting parts as shown below before you can proceed with creating a merge commit.

Diagram of a merging change.
Revise the change set to eliminate the conflict.

Subscribe to our newsletter

Learn with Nulab to bring your best ideas to life