How to handle merge conflicts in GitBook
Why do merge conflicts happen in GitBook and how do you resolve them? Our guide can help.
Last updated
Why do merge conflicts happen in GitBook and how do you resolve them? Our guide can help.
Last updated
Merge conflicts in GitBook occur when changes in a conflict with primary content. Here’s how to resolve them to maintain the best version of your documentation:
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.
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.