How to handle merge conflicts in GitBook
Why do merge conflicts happen in GitBook and how do you resolve them? Our guide can help.
Merge conflicts in GitBook occur when changes in a change request conflict with primary content. Here’s how to resolve them to maintain the best version of your documentation:
Understand the conflic
Conflicts can happen when a merge introduces incompatible changes, such as when you edit a content block that has been changed, or you remove files that GitBook is trying to update.
For example, if someone else on your team opens a change request at the same time you do, edits a few blocks and merges it, this will update the primary content. Your branch will be outdated, and you’ll be prompted to update your change request to bring in their changes.
However, if you’ve edited the same blocks as your teammate, you’ll need to decide which version you want to keep, and GitBook will flag it as a conflict.

Review and resolve conflicts
If there’s a conflict in your change request, you’ll see a notification when you try to merge. GitBook will show how many conflicts there are, and guide you through reviewing the two versions:
Primary (Purple) – The content currently in your GitBook space.
Changed (Green) – The changes proposed in this change request.
You can use the Keep primary or Keep changed buttons to decide which version to keep.

Mark as resolved and merge
Once you’ve resolved all the conflicts in your change request, you can hit Mark as resolved to confirm that you’ve updated all the issues. You can then merge your change request as normal by hitting the Merge button in the top-right corner of the screen.

Last updated
Was this helpful?