Git
Connect Git repositories to your space for seamless version control.
Manage the linkage between your GitBook space and external Git repositories, enabling commits, merges, and pull requests directly tied to your documentation.
Triggers an import from the linked Git repository into the space, updating the space's content to match the repository. This is an async operation — it runs in the background after the request returns 204. Use getSpaceGitInfo to check sync status. The space must already have a Git provider configured.
A unique entity identifier
^[a-zA-Z0-9_-]+$URL of the Git repository to import. It can contain basic auth credentials.
Git ref to import in the format "refs/heads/main"
Unique identifier to use to cache the Git repository across multiple operations.
URL to use as a prefix for external file references.
URL to use as a prefix for the commit URL.
Path to a root directory for the project in the repository.
The timestamp of the event that triggered this import. It ensures that Git sync import and export operations are executed in the same order on GitBook and on the remote repository.
If true, the import will generate a revision without updating the space primary content.
Operation to import the repository has been started.
No content
Operation to import the repository has been started.
No content
Triggers an export of the space's current content to the linked Git repository. This is an async operation — the export runs in the background after the request returns 204. Use getSpaceGitInfo to check the current git sync status. The space must already have a Git provider configured.
A unique entity identifier
^[a-zA-Z0-9_-]+$URL of the Git repository to export to. It can contain basic auth credentials.
Git ref to push the commit to in the format "refs/heads/main"
Message for the commit generated by the export
Unique identifier to use to cache the Git repository across multiple operations.
URL to use as a prefix for external file references.
URL to use as a prefix for the commit URL.
Path to a root directory for the project in the repository.
The timestamp of the event that triggered this export. It ensures that Git sync import and export operations are executed in the same order on GitBook and on the remote repository.
Operation to export the space has been started.
No content
Operation to export the space has been started.
No content
Returns metadata about the Git Sync provider connected to the space. Returns 404 if no Git provider is configured. Use this to check sync state before triggering an import or export.
A unique entity identifier
^[a-zA-Z0-9_-]+$The Git Sync info for the space
No Git provider currently set up on the space
Remove the legacy Git Sync installation from the space to be able to upgrade it to use the new Git integrations
A unique entity identifier
^[a-zA-Z0-9_-]+$The legacy Git installation was already removed
No content
The legacy Git installation was successfully removed
No content
Last updated
Was this helpful?