Skip to main content
Trinity
Guides/GitHub Sync

GitHub Sync

Keep agents in sync with GitHub repositories using two modes: Source mode (pull-only, default) and Working Branch mode (bidirectional).

Sync Modes

Source Mode (default) — Pull-only. The agent pulls from the repo but never pushes. Used for deploying agent code from a canonical source.
Working Branch Mode — Bidirectional. The agent has its own branch and can push changes back. Used for agents that modify their own code.
Branch Selection — Specify a branch via URL syntax github:owner/repo@branch during creation, or via the source_branch parameter in MCP.

Creating an Agent with Sync

Agents created from a GitHub template automatically get sync configured. The default mode is Source (pull-only).

Using Sync in the UI

1

Open the agent detail page to see Git status (branch, last sync, pending changes).

2

Click Pull to fetch the latest commits from the remote.

3

Click Sync to run a full sync operation (pull-only in Source mode; pull + push in Working Branch mode).

4

View the git log to inspect recent commits.

Initializing Sync for Existing Agents

Agents created without a GitHub repository can be connected after the fact:

Use the GitHub repo initialization flow in the UI.
Via MCP: initialize_github_sync(agent_name, repo_url)

Git Sync API

EndpointMethodDescription
/api/agents/{name}/git/statusGETGit sync status
/api/agents/{name}/git/syncPOSTTrigger sync
/api/agents/{name}/git/logGETRecent commits
/api/agents/{name}/git/pullPOSTPull from remote

MCP tool: initialize_github_sync(agent_name, repo_url)