Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.gravixlayer.ai/llms.txt

Use this file to discover all available pages before exploring further.

from gravixlayer import GravixLayer

client = GravixLayer()
runtime = client.runtime.create(template="python-3.14-base-small")

runtime.git.clone(
    url="https://github.com/octocat/Hello-World.git",
    path="/home/user/repo",
)
runtime.git.create_branch("/home/user/repo", "tmp-branch")
runtime.git.checkout("/home/user/repo", "master")

r = runtime.git.delete_branch("/home/user/repo", "tmp-branch")
print(r.success, r.exit_code)

# Force delete: runtime.git.delete_branch("/home/user/repo", "name", force=True)

runtime.kill()
The branch must not be the currently checked-out branch when you delete it.

Parameters

ParameterTypeRequiredDescription
repository_pathstringYesPath to the repository root inside the runtime
branch_namestringYesBranch to delete
forcebooleanNoIf true, use force delete (-D); otherwise safe delete (-d)

Response

FieldTypeDescription
successbooleanWhether the git command completed successfully
exit_codeintegerProcess exit code from git
stdoutstringStandard output from git
stderrstringStandard error from git
errorstringError message when the operation fails