For the complete documentation index, see llms.txt. This page is also available as Markdown.

Import or migrate your content to GitBook with Git Sync

Easily import content from your previous documentation provider — or from GitHub or GitLab — using Git Sync in GitBook

One of the best ways to import your content into GitBook is using Git Sync. With Git Sync, you can choose to import a repository from either GitHub or GitLab, to add all your docs to a GitBook site in just a few minutes.

Git Sync allows you to sync multiple spaces and folders of content into one GitBook site.

1

Create or open your site

Create a site and add each section to its navigation. Match each section to a directory in your repository.

2

Connect your repository

From your site dashboard, open Git Sync in the sidebar. Authenticate with GitHub or GitLab, then select your repository and branch.

3

Map your sections

Review the directory mapping for each section. Make sure every section points to the correct repository directory.

4

Choose the initial sync direction

Choose one of these directions:

  • Repository → GitBook: Import content from the selected branch into your space.

  • GitBook → repository: Export your space content to the selected branch.

5

Start and verify the sync

Click Sync to import your content. Confirm that each repository directory appears in the expected site section.

You can sync a single space of a GitBook site with a Git repository by following these steps:

1

Open Git Sync

In your GitBook space, click Set up Git Sync.

2

Configure GitHub or GitLab

GitHub

Install the GitBook app on GitHub. Grant access to selected repositories or all repositories.

In GitBook, authorize GitBook with GitHub and select the account that contains your content.

Authorize GitBook with GitHub and select the account that contains your content.

GitLab

In GitLab, select SettingsAccess Tokens. Create a personal access token with these scopes:

  • api

  • read_repository

  • write_repository

In GitBook, enter the token and click Authenticate.

Create a GitLab access token, then authenticate GitBook.
3

Select your repository and branch

Select the repository and branch that contain the section you want to import.

Select a repository and branch, then choose the initial sync direction.
4

Choose the initial sync direction

Choose one of these directions:

  • Repository → GitBook: Import content from the selected branch into your space.

  • GitBook → repository: Export your space content to the selected branch.

5

Start and verify the sync

Click Sync to start the initial sync. After it finishes, Git Sync keeps GitBook and your repository synchronized in both directions.

Last updated

Was this helpful?

Powered by GitBook