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
| Provider | Supported |
|---|---|
| GitHub | Yes |
| GitLab | Yes |
| Bitbucket | Yes |
Setup
1. Create a Personal Access Token
- GitHub
- GitLab
- Bitbucket
- Go to GitHub Settings → Developer settings → Personal access tokens
- Generate a new token with
reposcope - Copy the token
2. Configure in ondoki
Navigate to Project Settings → Integrations or use the API: Endpoint:PUT /api/v1/git-sync/{project_id}
| Field | Description |
|---|---|
provider | github, gitlab, or bitbucket |
repo_url | Full repository URL |
branch | Target branch (default: main) |
directory | Target directory within the repo (default: /) |
access_token | Personal access token (encrypted at rest) |
3. Export
Trigger an export manually: Endpoint:POST /api/v1/git-sync/{project_id}/export
This:
- Fetches all documents in the project, ordered by folder structure
- Converts TipTap JSON content to Markdown
- Creates the folder hierarchy in the target repo
- Commits one
.mdfile per document with metadata - 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
| Action | Endpoint |
|---|---|
| Get config | GET /api/v1/git-sync/{project_id} |
| Set/update config | PUT /api/v1/git-sync/{project_id} |
| Remove config | DELETE /api/v1/git-sync/{project_id} |
| Trigger export | POST /api/v1/git-sync/{project_id}/export |
Security
- Access tokens are encrypted at rest using the
ONDOKI_ENCRYPTION_KEYFernet 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:| Field | Description |
|---|---|
last_sync_at | Timestamp of last export |
last_sync_status | success, error, or in_progress |
last_sync_error | Error 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).