Git
Every project is backed by a native git store. Commits snapshot the working tree of a branch; all ids are commit SHAs. Committing also syncs to a connected GitHub repository when one is linked.
GET /api/v1/projects/{id}/git/logQuery: branch (default main), limit (default 50, max 200). Returns { commits } — each { oid, message, author_id, committed_at, parent_oids }.
await client.git.log(projectId, { branch: 'main', limit: 20 })Commit
Section titled “Commit”POST /api/v1/projects/{id}/git/commitCommits all current project files (there is no staging index). Body: optional message, optional branch. Returns { commit: { oid, branch } }.
const { oid } = await client.git.commit(projectId, { message: 'Before refactor' })Show a commit
Section titled “Show a commit”GET /api/v1/projects/{id}/git/commits/{oid}Returns the commit plus the materialized files at that revision: { commit: { …, files } }.
await client.git.show(projectId, oid)Restore
Section titled “Restore”POST /api/v1/projects/{id}/git/restoreBody: oid (required), optional branch. Restores the working tree to that commit as a new commit on the branch. Returns { commit: { oid, branch } }.
await client.git.restore(projectId, oid)POST /api/v1/projects/{id}/git/mergeBody: source (required), optional target (default main). Returns { merge: { oid, fastForward } }.
await client.git.merge(projectId, { source: 'feature/nav', target: 'main' })Branches
Section titled “Branches”GET /api/v1/projects/{id}/git/branches list → { branches }POST /api/v1/projects/{id}/git/branches create → { branch }DELETE /api/v1/projects/{id}/git/branches/{name} delete → { deleted }Create takes name (required) and optional from (default main). main cannot be deleted.
await client.git.branches.list(projectId)await client.git.branches.create(projectId, 'feature/nav', { from: 'main' })await client.git.branches.delete(projectId, 'feature/nav')