Sign Up

GitService

class GitService()

Sandbox git namespace.

GitService.__init__

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

GitService.add

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

Stage files.

GitService.add_remote

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

GitService.checkout_branch

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

Checkout a branch.

GitService.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.

GitService.commit

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

Commit staged changes, optionally allowing an empty commit.

GitService.create_branch

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

Create a branch.

GitService.delete_branch

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

Delete a branch.

GitService.get_config

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

GitService.history

def history(path: str) -> ListResult

List commits, newest first.

GitService.init

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

GitService.list_branches

def list_branches(path: str) -> ListResult

List branch names as {items, next_cursor}.

GitService.list_remotes

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

GitService.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.

GitService.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.

GitService.reset

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

GitService.restore

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

GitService.set_config

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

GitService.status

def status(path: str) -> GitStatus

Return git status.

AsyncGitService

class AsyncGitService()

Sandbox git namespace.

AsyncGitService.__init__

def __init__(transport: AsyncTransport) -> None

AsyncGitService.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.

AsyncGitService.init

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

AsyncGitService.status

async def status(path: str) -> GitStatus

Return git status.

AsyncGitService.list_branches

async def list_branches(path: str) -> ListResult

List branch names as {items, next_cursor}.

AsyncGitService.list_remotes

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

AsyncGitService.history

async def history(path: str) -> ListResult

List commits, newest first.

AsyncGitService.create_branch

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

Create a branch.

AsyncGitService.add_remote

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

AsyncGitService.delete_branch

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

Delete a branch.

AsyncGitService.checkout_branch

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

Checkout a branch.

AsyncGitService.add

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

Stage files.

AsyncGitService.reset

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

AsyncGitService.restore

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

AsyncGitService.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.

AsyncGitService.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.

AsyncGitService.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.

AsyncGitService.get_config

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

AsyncGitService.set_config

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

GitCommitResponse

GitCommitResponse = _gen.toolbox.CommitResponse

GitStatus

GitStatus = _gen.toolbox.StatusResponse