Sign Up

GitService

class GitService()

Sandbox git namespace.

GitService.__init__

def __init__(transport: AsyncTransport) -> None

GitService.clone

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.

GitService.init

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

GitService.status

async def status(path: str) -> GitStatus

Return git status.

GitService.list_branches

async def list_branches(path: str) -> ListResult

List branch names as {items, next_cursor}.

GitService.list_remotes

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

GitService.history

async def history(path: str) -> ListResult

List commits, newest first.

GitService.create_branch

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

Create a branch.

GitService.add_remote

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

GitService.delete_branch

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

Delete a branch.

GitService.checkout_branch

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

Checkout a branch.

GitService.add

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

Stage files.

GitService.reset

async def reset(path: str,
                *,
                mode: Optional[str] = None,
                target: Optional[str] = None,
                files: Optional[Sequence[str]] = None) -> None

GitService.restore

async def restore(path: str,
                  files: Sequence[str],
                  *,
                  staged: Optional[bool] = None,
                  worktree: Optional[bool] = None,
                  source: Optional[str] = None) -> None

GitService.commit

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

Commit staged changes, optionally allowing an empty commit.

GitService.pull

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.

GitService.push

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.

GitService.get_config

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

GitService.set_config

async def set_config(key: str,
                     value: str,
                     *,
                     path: Optional[str] = None,
                     scope: str = 'global') -> None

SyncGitService

class SyncGitService()

Sandbox git namespace.

SyncGitService.__init__

def __init__(impl: GitService, bridge: SyncBridge) -> None

SyncGitService.add

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

Stage files.

SyncGitService.add_remote

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

SyncGitService.checkout_branch

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

Checkout a branch.

SyncGitService.clone

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.

SyncGitService.commit

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

Commit staged changes, optionally allowing an empty commit.

SyncGitService.create_branch

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

Create a branch.

SyncGitService.delete_branch

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

Delete a branch.

SyncGitService.get_config

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

SyncGitService.history

def history(path: str) -> ListResult

List commits, newest first.

SyncGitService.init

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

SyncGitService.list_branches

def list_branches(path: str) -> ListResult

List branch names as {items, next_cursor}.

SyncGitService.list_remotes

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

SyncGitService.pull

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.

SyncGitService.push

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.

SyncGitService.reset

def reset(path: str,
          *,
          mode: Optional[str] = None,
          target: Optional[str] = None,
          files: Optional[Sequence[str]] = None) -> None

SyncGitService.restore

def restore(path: str,
            files: Sequence[str],
            *,
            staged: Optional[bool] = None,
            worktree: Optional[bool] = None,
            source: Optional[str] = None) -> None

SyncGitService.set_config

def set_config(key: str,
               value: str,
               *,
               path: Optional[str] = None,
               scope: str = 'global') -> None

SyncGitService.status

def status(path: str) -> GitStatus

Return git status.

GitCommitResponse

GitCommitResponse = _gen.toolbox.CommitResponse

GitStatus

GitStatus = _gen.toolbox.StatusResponse