Skip to content
View as Markdown
class GitService()

Sandbox git namespace.

def __init__(impl: AsyncGitService, bridge: SyncBridge) -> None
def add(path: str, files: Sequence[str]) -> None

Stage files.

def add_remote(path: str, name: str, url: str) -> None
def checkout_branch(path: str, branch: str) -> None

Checkout a branch.

def clone(url: str,
path: str,
*,
branch: Optional[str] = None,
commit_id: Optional[str] = None,
depth: Optional[int] = None,
insecure_skip_tls: bool = False,
username: Optional[str] = None,
password: Optional[str] = None,
timeout: Optional[float] = None) -> None

Clone a repository, optionally shallow and with per-call TLS relaxation.

def commit(path: str,
message: str,
*,
author: str,
email: str,
allow_empty: bool = False) -> GitCommitResponse

Commit staged changes, optionally allowing an empty commit.

def create_branch(path: str, name: str) -> None

Create a branch.

def delete_branch(path: str, name: str) -> None

Delete a branch.

def get_config(key: str,
*,
path: Optional[str] = None,
scope: str = 'global') -> Optional[str]
def history(path: str) -> ListResult

List commits, newest first.

def init(path: str, *, bare: bool = False, initial_branch: Optional[str] = None) -> None
def list_branches(path: str) -> ListResult

List branch names as {items, next_cursor}.

def list_remotes(path: str) -> ListResult[JsonObject]
def pull(path: str,
*,
username: Optional[str] = None,
password: Optional[str] = None,
branch: Optional[str] = None,
remote: Optional[str] = None,
timeout: Optional[float] = None) -> None

Pull from the configured or named remote.

def push(path: str,
*,
username: Optional[str] = None,
password: Optional[str] = None,
branch: Optional[str] = None,
remote: Optional[str] = None,
set_upstream: bool = False,
timeout: Optional[float] = None) -> None

Push to the configured or named remote.

def reset(path: str,
*,
mode: Optional[str] = None,
target: Optional[str] = None,
files: Optional[Sequence[str]] = None) -> None
def restore(path: str,
files: Sequence[str],
*,
staged: Optional[bool] = None,
worktree: Optional[bool] = None,
source: Optional[str] = None) -> None
def set_config(key: str,
value: str,
*,
path: Optional[str] = None,
scope: str = 'global') -> None
def status(path: str) -> GitStatus

Return git status.

class AsyncGitService()

Sandbox git namespace.

def __init__(transport: AsyncTransport) -> None
async def clone(url: str,
path: str,
*,
branch: Optional[str] = None,
commit_id: Optional[str] = None,
depth: Optional[int] = None,
insecure_skip_tls: bool = False,
username: Optional[str] = None,
password: Optional[str] = None,
timeout: Optional[float] = None) -> None

Clone a repository, optionally shallow and with per-call TLS relaxation.

async def init(path: str,
*,
bare: bool = False,
initial_branch: Optional[str] = None) -> None
async def status(path: str) -> GitStatus

Return git status.

async def list_branches(path: str) -> ListResult

List branch names as {items, next_cursor}.

async def list_remotes(path: str) -> ListResult[JsonObject]
async def history(path: str) -> ListResult

List commits, newest first.

async def create_branch(path: str, name: str) -> None

Create a branch.

async def add_remote(path: str, name: str, url: str) -> None
async def delete_branch(path: str, name: str) -> None

Delete a branch.

async def checkout_branch(path: str, branch: str) -> None

Checkout a branch.

async def add(path: str, files: Sequence[str]) -> None

Stage files.

async def reset(path: str,
*,
mode: Optional[str] = None,
target: Optional[str] = None,
files: Optional[Sequence[str]] = None) -> None
async def restore(path: str,
files: Sequence[str],
*,
staged: Optional[bool] = None,
worktree: Optional[bool] = None,
source: Optional[str] = None) -> None
async def commit(path: str,
message: str,
*,
author: str,
email: str,
allow_empty: bool = False) -> GitCommitResponse

Commit staged changes, optionally allowing an empty commit.

async def pull(path: str,
*,
username: Optional[str] = None,
password: Optional[str] = None,
branch: Optional[str] = None,
remote: Optional[str] = None,
timeout: Optional[float] = None) -> None

Pull from the configured or named remote.

async def push(path: str,
*,
username: Optional[str] = None,
password: Optional[str] = None,
branch: Optional[str] = None,
remote: Optional[str] = None,
set_upstream: bool = False,
timeout: Optional[float] = None) -> None

Push to the configured or named remote.

async def get_config(key: str,
*,
path: Optional[str] = None,
scope: str = 'global') -> Optional[str]
async def set_config(key: str,
value: str,
*,
path: Optional[str] = None,
scope: str = 'global') -> None
GitCommitResponse = _gen.toolbox.CommitResponse
GitStatus = _gen.toolbox.StatusResponse