GitHub Integration
Before integrating your book with GitHub, you need to authorize GitBook to get access to your GitHub account.
In your account settings, connect your GitHub account with the correct permissions:
- Default permissions: only access your GitHub account to authenticate you during login
- Access to webhook: access your GitHub account to create a webhook on your specified repository (See ).
- Access to private repositories: same as above but with access to private repositories
When creating a new book, the tab let you choose one of your GitHub repository to import.
Webhooks notify GitBook when your GitHub repository changes.
If your GitHub changes are not available on GitBook, the main source of the problem is the webhook. You can check the state of your webhook in your repository’s settings.
When your GitHub account is correctly linked to your GitBook account, linking a book to a repository is easy.
The sync is unidirectional, only changes made on GitHub will trigger builds on GitBook, GitBook will not update your GitHub repository with any content written before.
- Open the GitHub section in your book settings
- Enter your repository id (such as:
YourGitHubUserName/RepoName
) - Save your settings
You can now edit your GitHub repository from the web editor (if you have authorized the correct permissions), and your commit on GitHub will trigger builds on GitBook
My Book is not being updated / I can’t see any builds
If you linked your GitHub repository to a GitBook but editing content doesn’t trigger any build.
Verify that the webhook has been correctly added to your GitHub repository (in your GitHub repository settings -> Webhook). If the webhook is not present or invalid, add it back from your book’s settings.