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

# Git Clone

> Clone a remote repository into an agent runtime

```python theme={null}
from gravixlayer import GravixLayer

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

r = runtime.git.clone(
    url="https://github.com/octocat/Hello-World.git",
    path="/home/user/repo",
    branch="master",
    depth=1,
)
print(r.success, r.exit_code)
print(r.stdout[:500] if r.stdout else r.stderr)

runtime.kill()
```

`url` must use `http://`, `https://`, `ssh://`, `git://`, or SCP-style SSH (for example `git@github.com:org/repo.git`). The `file://` scheme is not allowed.

For private HTTPS repositories, pass `auth_token`; the API uses it only for that clone.

## Parameters

| Parameter    | Type    | Required | Description                                                |
| ------------ | ------- | -------- | ---------------------------------------------------------- |
| `url`        | string  | Yes      | Remote repository URL (allowed schemes only)               |
| `path`       | string  | Yes      | Directory inside the runtime where the repo will be cloned |
| `branch`     | string  | No       | Branch to check out after clone                            |
| `depth`      | integer | No       | Shallow clone depth (`git clone --depth`)                  |
| `auth_token` | string  | No       | Token for HTTPS authentication (private repos)             |

## Response

| Field       | Type    | Description                                    |
| ----------- | ------- | ---------------------------------------------- |
| `success`   | boolean | Whether the git command completed successfully |
| `exit_code` | integer | Process exit code from `git`                   |
| `stdout`    | string  | Standard output from `git`                     |
| `stderr`    | string  | Standard error from `git`                      |
| `error`     | string  | Error message when the operation fails         |
