In case of errors, make sure that:
- Your repository has a
README.mdfile at its root (or at therootfolder specified in your.gitbook.yaml). This file is required and is used as the homepage for your documentation. For more details, refer to our content configuration. - If you have YAML frontmatters in your Markdown files, make sure they are valid using a linter.
By default, GitBook uses the root of the repository as a starting point. A specific directory can be specified to scope the markdown files. Take a look at our documentation on content configuration for more details.
When synchronizing and editing from GitBook with an existing Git repository, GitBook may create new markdown files instead of using the existing ones. This is done to ensure GitBook doesn't overrite files that existed in your repository before.
Make sure that you have installed the GitBook GitHub app to the correct locations (when installing the app, you can choose to install it to your personal GitHub, or to any organization you have permissions for) and that you have given the app the correct repository permissions.
Make sure that your access token has been configured with the following access:
apiread_repositorywrite_repository
Make sure that all the folders in your repo are in lowercase. For example, if you have a folder called Hello_World GitBook won’t sync that folder correctly. Update the name of your folder to all lowercase, and enable sync again.
{% hint style="warning" %}
This section specifically addresses problems when a SUMMARY.md file already exists
If your repository does not include a SUMMARY.md file, GitBook will automatically create one upon the first sync. This means that if you edited your content from GitBook at least once after setting up Git sync, GitBook should have created this file automatically.
{% endhint %}
If after updating your repository by adding or modifying a markdown file, you do not see the update reflected on GitBook and the sidebar doesn’t indicate an error during the sync, your modified file(s) is probably not listed in your SUMMARY.md file.
This could either be because you created the file manually, or because you made an edit on GitBook and the GitBook to Git export phase of the sync created it for you.
The content of this file mirrors your table of contents on GitBook and is used during the Git to GitBook import phase of the sync to recreate your table of contents and re-conciliate upcoming updates from the repository with your existing content on GitBook.
If after ensuring that all your files are included in the SUMMARY.md file there’s still nothing happening on GitBook, don’t hesitate to contact support for assistance.
This error usually occurs when the GitHub account that you use to set up the sync is already associated with a different GitBook user account.
A good way to identify which GitBook account the GitHub account is already linked to is:
- Log out from your current GitBook user session (i.e.
name@email.com) - Log out from any GitHub user sessions.
- Go to the Log in page.
- Select the "Sign in with GitHub" option.
- Enter your GitHub credentials.
- Once logged in, go to the account settings and either:
- Unlink the account from the "Third-party Login > GitHub" section in the Personal setting
- Delete the account altogether if you do not need it.
- Log out from the session.
- Log back in using your
name@email.comGitBook account. - Try to set up Git Sync again.