GitApi
Class: GitApi
Defined in: CodeBolt/packages/clientsdk/src/api/git.api.ts:30
Provides Git version control operations for the workspace.
This API wraps common Git commands -- init, commit, push, pull, branch management, and diff inspection -- allowing agents and UI components to interact with the project's Git repository programmatically.
Constructors
Constructor
new GitApi(http: HttpClient): GitApi;
Defined in: CodeBolt/packages/clientsdk/src/api/git.api.ts:31
Parameters
| Parameter | Type |
|---|---|
http | HttpClient |
Returns
GitApi
Methods
branch()
branch(data?: GitBranchRequest): Promise<GitBranch[]>;
Defined in: CodeBolt/packages/clientsdk/src/api/git.api.ts:289
Lists branches in the repository.
Returns all local (and optionally remote) branches with their metadata. Useful for branch selection UIs and workflow logic.
Parameters
| Parameter | Type | Description |
|---|---|---|
data? | GitBranchRequest | Optional parameters to filter branches (e.g., local-only, remote) |
Returns
Promise<GitBranch[]>
A promise that resolves to an array of GitBranch objects
Example
const branches = await client.git.branch();
branches.forEach(b => console.log(b.name));