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.
Import a Git repository
post
Authorizations
Path parameters
spaceIdstringRequired
The unique id of the space
Body
urlstringRequired
URL of the Git repository to import. It can contain basic auth credentials.
refstringRequired
Git ref to import in the format "refs/heads/main"
repoCacheIDstringOptional
Unique identifier to use to cache the Git repository across multiple operations.
repoTreeURLstringOptional
URL to use as a prefix for external file references.
repoCommitURLstringOptional
URL to use as a prefix for the commit URL.
repoProjectDirectorystringOptional
Path to a root directory for the project in the repository.
timestampstring · date-timeOptional
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.
forcebooleanOptional
standalonebooleanOptional
If true, the import will generate a revision without updating the space primary content.
Operation to import the repository has been started.
No content
Export the to a Git repository
post
Authorizations
Path parameters
spaceIdstringRequired
The unique id of the space
Body
urlstringRequired
URL of the Git repository to export to. It can contain basic auth credentials.
refstringRequired
Git ref to push the commit to in the format "refs/heads/main"
commitMessagestringRequired
Message for the commit generated by the export
repoCacheIDstringOptional
Unique identifier to use to cache the Git repository across multiple operations.
repoTreeURLstringOptional
URL to use as a prefix for external file references.
repoCommitURLstringOptional
URL to use as a prefix for the commit URL.
repoProjectDirectorystringOptional
Path to a root directory for the project in the repository.
timestampstring · date-timeOptional
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.