Remote Git Backends
A remote Git backend stores the Synth Project itself in a Git repository. After an ingestion revision succeeds, Synth updates the repository using the method you selected for that Project.
This is different from a Git watcher:
| Feature | Purpose | Direction |
|---|---|---|
| Remote Git backend | Store the Synth Project, including its knowledge/ pages. | Synth to the repository after ingestion; repository to Synth only when you explicitly import or pull. |
| Git watcher | Read selected source files into a Synth Project. | Source repository to Synth. |
Many teams use both. A watcher imports product documentation, while a remote backend saves the resulting Synth Project in a separate knowledge repository.
Choose how updates happen
Every new Git-backed Project requires one update method.
| Method | Choose it when | What Synth does |
|---|---|---|
Pull request (pullRequest) | The target is protected, or changes require checks and review. This is the recommended team default. | Updates a stable Synth branch and opens or refreshes a GitHub pull request or GitLab merge request. |
Direct (direct) | The selected credential may push to the target and review is not required. | Pushes to the target without force and verifies the exact Project tree. |
Branch (branch) | Another tool or a person will perform promotion. | Updates a stable Synth branch and leaves the target unchanged. No provider API is needed. |
Synth never silently changes methods after an error. For example, a rejected
direct push stays rejected instead of being converted into a pull request.
This makes authentication, branch policy, and network problems visible and
keeps the repository workflow under your control.
Simple configuration
The smallest configuration is:
backend:
type: git
config:
remote_url: https://github.com/acme/knowledge.git
update_method: pullRequest
Synth resolves the repository's default branch and uses
projects/<project-name> as the Project folder.
Add advanced fields only when you need them:
backend:
type: git
config:
remote_url: https://gitlab.com/acme/knowledge.git
update_method: pullRequest
target_branch: release
project_subdir: team-memory/platform
credential_id: gitlab-write
auto_merge: false
| Field | Required | Meaning |
|---|---|---|
remote_url | Yes | HTTPS or SSH clone URL. |
update_method | Yes | pullRequest, direct, or branch. Values are case-sensitive. |
target_branch | No | $default uses the repository's default branch. Otherwise specify a branch such as main or release. |
project_subdir | No | Relative repository folder. Defaults to projects/<project-name>. |
credential_id | No | Stored GitHub or GitLab credential for a private HTTPS repository and provider requests. |
auto_merge | No | With pullRequest, ask the provider to merge after all normal policy requirements pass. Defaults to false. |
Provider and enterprise-instance fields are not part of Project configuration.
Synth recognizes github.com and gitlab.com from the URL. Administrators
register enterprise hosts once for the deployment.
Set it up in the web app
To create a new Project:
- Open Projects and select New.
- Set Project Storage to Git.
- Enter the repository URL.
- Choose Pull request, Direct, or Branch.
- Select a stored credential if the repository is private.
- Open Advanced Git settings only if you need a non-default target, different Project folder, or automatic merge.
To use a Project already stored in the repository, select Import instead. Import is a one-time action: Synth reads the chosen folder when the Project is created. It does not enable a hidden background pull.
To connect an existing local Project, open the Project card's Storage action. Choose Pull existing Project files after saving only when the remote folder should replace the local Project content.
Repository layout
One repository can contain several Synth Projects:
synth-knowledge/
projects/
backend-api/
knowledge/
.synth/
customer-portal/
knowledge/
.synth/
Use a relative folder such as projects/backend-api. Absolute paths, . and
.. segments are rejected. Files outside the configured Project folder are
preserved when Synth updates the repository.
What happens after ingestion
After Synth commits a successful ingestion revision:
- The newest Project snapshot enters a durable repository queue.
- The worker uses the Project's configured method.
- Synth verifies the remote branch tree after a push, including after an ambiguous network response.
- The Project shows the observed state rather than reporting every push as complete.
Possible states are:
| State | Meaning |
|---|---|
| Updated | The target contains the expected Project snapshot. |
| Waiting for merge | A pull request or merge request is open; the target has not changed yet. |
| Branch updated; target unchanged | The branch method completed. |
| Retrying | A transient problem can be retried. |
| Needs attention | A credential, policy, configuration, concurrency, or safety issue needs a person. |
A repository problem does not erase or reclassify the successful ingestion. The repository state remains visible and retryable on its own.
Pause, resume, and update now
Open Storage on the Project card to use these controls:
- Pause repository updates stops background attempts without changing the repository URL or update method. Pending work is retained.
- Resume repository updates restarts background attempts. Synth publishes the newest queued snapshot.
- Update repository now runs one explicit attempt. It works while background updates are paused, which is useful during incident recovery.
Pausing outbound updates does not pull from the repository. Pulling remote changes is always an explicit action.
Protected branches
Use pullRequest when the target branch requires reviews, status checks, a
merge queue, or a merge train. Synth updates the same owned branch and request
on retries, so repeated ingestions do not create a stream of duplicate pull or
merge requests.
auto_merge: true is only a request to GitHub or GitLab. All repository rules
still apply. If automatic merge cannot be enabled, the request remains open for
a person to merge.
If you choose direct and the server rejects target pushes, change the Project
configuration to pullRequest or branch. Synth will not make that policy
choice for you.
Credentials
For a private HTTPS repository, choose one stored GitHub or GitLab credential.
The token needs clone and branch-write access. pullRequest also needs access to
create and update pull requests or merge requests. Automatic merge needs the
provider's corresponding merge permission.
For SSH URLs, the deployment can supply an SSH key and strict known-host
configuration. The pullRequest method still needs a stored provider token for
the GitHub or GitLab API.
Credentials are organization resources; their secret values are never written into Project metadata, Git URLs, commits, or status files. The picker shows Global credentials and Personal credentials available to the current user. See Credentials for the visibility model.
Use an HTTPS or SSH repository URL without embedded credentials, query parameters, or fragments. Select the credential separately; do not place a username, token, or password in the repository URL.
GitHub and GitLab Enterprise
Administrators register enterprise hosts in every web and ingestion-worker
process through SYNTH_GIT_HOSTING_INSTANCES:
{
"github-production": {
"provider": "github",
"web_url": "https://github.company.example",
"api_url": "https://github.company.example/api/v3",
"clone_hosts": ["github.company.example"],
"ca_bundle": "/etc/synth/git/company-ca.pem",
"ssh_known_hosts": "/etc/synth/git/known_hosts"
},
"gitlab-production": {
"provider": "gitlab",
"web_url": "https://gitlab.company.example",
"api_url": "https://gitlab.company.example/api/v4",
"clone_hosts": ["gitlab.company.example"]
}
}
The repository hostname selects the registered instance; users do not choose an
API URL. A host must match exactly one instance. Mount referenced CA bundles and
known-host files into the startup, web, and worker containers. Top-level Helm
extraEnv, extraEnvFrom, extraVolumes, and extraVolumeMounts apply the
shared configuration.
CaSC example
projects:
team-docs:
backend:
type: git
config:
remote_url: https://github.com/acme/synth-knowledge.git
update_method: pullRequest
target_branch: $default
project_subdir: projects/team-docs
credential_id: github-write
auto_merge: false
For an existing remote Project, perform the import from the Projects UI or use the REST create action described below. CaSC applies the stored configuration; it does not continuously pull the repository.
Server CLI example
On a Synth server installation, create a Git-backed Project with:
synth project create team-docs \
--backend git \
--git-url https://github.com/acme/synth-knowledge.git \
--git-update-method pullRequest \
--git-target-branch '$default' \
--git-project-subdir projects/team-docs \
--git-credential github-write
Add --git-auto-merge only when the repository should merge through its normal
policy as soon as all requirements pass. The standalone customer CLI is a
remote client and does not create server-side storage backends.
REST operations
The REST API reference has copy-paste examples. The main operations are:
GET /api/projects/{name}/backend
PUT /api/projects/{name}/backend
POST /api/projects/{name}/backend/update
POST /api/projects/{name}/backend/pause
POST /api/projects/{name}/backend/resume
Verify the first update
- In Projects, open Storage and inspect the repository state.
- Confirm the configured folder exists on the expected branch.
- For
pullRequest, open the linked pull or merge request and verify its base, source branch, checks, and changed Project folder. - Confirm unrelated repository files were preserved.
- Read a known page through Explore or MCP to verify the local revision still serves the expected evidence.
Troubleshooting
| Symptom | Check |
|---|---|
| Import says the folder is missing | Confirm project_subdir exists on target_branch. Import does not search other branches or folders. |
| Direct update is rejected | Confirm the token can push to the target. If protection is intentional, explicitly choose pullRequest or branch. |
| Waiting for merge | Open the linked request and complete its checks, reviews, merge queue, or merge train. |
| Remote Project changes were detected | Reconcile edits made directly inside project_subdir, then use Update repository now. Synth stops before overwriting them. |
| Update branch conflict | Preserve the branch and check who changed it. Synth refuses to force-update a branch it cannot prove it owns. |
| Enterprise host is not registered | Ask an administrator to add the hostname to SYNTH_GIT_HOSTING_INSTANCES in the startup, web, and worker processes. |
| Authentication fails | Verify the credential type, token validity, repository access, and API scopes. For SSH, also verify the mounted key and known-host file. |
| Retrying does not clear | Check provider availability, DNS, outbound proxy rules, custom CA mounts, and ingestion-worker logs. |
| Pages exist locally but Explore is unready | This is a local read-snapshot problem, not a repository update. Inspect the Project's canonical read snapshot. |
Previous configuration
Existing Projects using the former fields continue to load and are normalized to the new contract. In particular, the old disabled-push setting becomes an operational pause, and the old pull setting is removed because repository pulls are explicit. New configuration should use only the fields shown on this page. Self-hosted operators should follow the Git backend upgrade runbook before allowing new configuration to run alongside existing deployments.