sandbox.git helpers for common repository workflows such as cloning, branching, committing, pulling, pushing, managing remotes, and configuring Git.
Authentication and identity
Inline credentials
For private HTTPS repositories, pass a username and password or token directly to operations such aspush, pull, or clone.
Authenticate once with the Git credential helper
You can usedangerouslyAuthenticate() in JavaScript or dangerously_authenticate() in Python to store credentials inside the sandbox credential helper.
Credentials are written to disk inside the sandbox and can be read by anything with sandbox access.
Keep credentials in the remote URL
By default, credentials are removed from the remote URL after clone. To retain them in.git/config, set dangerouslyStoreCredentials: true (JS) or dangerously_store_credentials=True (Python).
Credentials kept in a remote URL remain in repo config and are readable by sandbox processes.
Configure commit identity
You can useconfigureUser (JS) or configure_user (Python) to set commit author details globally or locally for a repository.
Clone repositories
Supported clone options include destination path, branch selection, depth, username, password, and credential-storage behavior.Check repository status and branches
You can usestatus() to inspect current branch, ahead/behind counts, and file status.
You can use branches() to get the branch list and current branch.
Create, switch, and delete branches
Stage and commit changes
You can useadd to stage all changes or selected files.
You can use commit to create commits. Options include custom author name, author email, and empty commits.
Pull and push
push and pull can use the configured upstream by default. You can also specify remote, branch, and upstream configuration.
Manage remotes
You can useremoteAdd (JS) or remote_add (Python) to add remotes, optionally fetch after adding, or overwrite an existing remote.
Git configuration
You can usesetConfig / set_config and getConfig / get_config to manage Git settings globally or per repository.