Error when pushing to the repository with protected branch

This error occurs when your Git branch is protected.

Error: Missing permissions to push to the refs/heads/main protected branch. Check your branch configuration on your git provider.

Git Sync requires our bot to make and push changes to your repo without restrictions. This means that even during setup, our app must have full permission to make those changes.

You need to allow the GitBook app to bypass any branch protections for the Git Sync sync to work.

Supported branch protections

Currently, we support the following branch protections:

  • Require a pull request before merging

  • Restrict who can push to matching branches

In both cases, you can allow the app to bypass specific teams or apps.

To do so, navigate to your settings in GitHub and allow gitbook-com to bypass those restrictions. The branch protections should look like this:

How to allow GitBook to bypass specifc branch protection rules

Last updated

Was this helpful?