Skip to main content

Overview

Git Sync exports your ondoki documents to a Git repository as Markdown files. It’s a one-way sync — changes in ondoki are pushed to Git, but changes in Git are not pulled back.

Supported Providers

ProviderSupported
GitHubYes
GitLabYes
BitbucketYes

Setup

1. Create a Personal Access Token

  1. Go to GitHub Settings → Developer settings → Personal access tokens
  2. Generate a new token with repo scope
  3. Copy the token

2. Configure in ondoki

Navigate to Project Settings → Integrations or use the API: Endpoint: PUT /api/v1/git-sync/{project_id}
{
  "provider": "github",
  "repo_url": "https://github.com/yourorg/docs-repo.git",
  "branch": "main",
  "directory": "/",
  "access_token": "ghp_your_token_here"
}
FieldDescription
providergithub, gitlab, or bitbucket
repo_urlFull repository URL
branchTarget branch (default: main)
directoryTarget directory within the repo (default: /)
access_tokenPersonal access token (encrypted at rest)

3. Export

Trigger an export manually: Endpoint: POST /api/v1/git-sync/{project_id}/export This:
  1. Fetches all documents in the project, ordered by folder structure
  2. Converts TipTap JSON content to Markdown
  3. Creates the folder hierarchy in the target repo
  4. Commits one .md file per document with metadata
  5. Pushes to the configured branch

Export Format

Each document is exported as a Markdown file:
  • File name: derived from the document name
  • Content: TipTap JSON converted to standard Markdown
  • Location: follows the folder hierarchy from ondoki

Configuration Management

ActionEndpoint
Get configGET /api/v1/git-sync/{project_id}
Set/update configPUT /api/v1/git-sync/{project_id}
Remove configDELETE /api/v1/git-sync/{project_id}
Trigger exportPOST /api/v1/git-sync/{project_id}/export

Security

  • Access tokens are encrypted at rest using the ONDOKI_ENCRYPTION_KEY Fernet key
  • Tokens are never returned in API responses after initial storage
  • The token is decrypted only when performing a Git operation

Sync Status

The configuration tracks the last sync:
FieldDescription
last_sync_atTimestamp of last export
last_sync_statussuccess, error, or in_progress
last_sync_errorError message if the last sync failed

Limitations

  • One-way only — ondoki → Git. Changes made directly in the Git repo are not synced back.
  • Manual trigger — exports must be triggered manually (no automatic sync on document save).
  • Documents only — workflows are not exported via Git Sync (use PDF/Markdown export instead).