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

> Push commits to a remote repository

```python theme={null}
import os

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",
)

user, pwd = os.environ.get("GIT_USERNAME"), os.environ.get("GIT_PASSWORD")
if user and pwd:
    r = runtime.git.push(
        "/home/user/repo",
        remote="origin",
        username=user,
        password=pwd,
    )
    print(r.success, r.stderr or r.stdout)

runtime.kill()
```

## Parameters

| Parameter         | Type   | Required | Description                                                     |
| ----------------- | ------ | -------- | --------------------------------------------------------------- |
| `repository_path` | string | Yes      | Path to the repository root inside the runtime                  |
| `remote`          | string | No       | Remote name (for example `origin`)                              |
| `refspec`         | string | No       | Refspec to push (for example `refs/heads/main:refs/heads/main`) |
| `username`        | string | No       | Username for authenticated push (HTTPS)                         |
| `password`        | string | No       | Password or token for authenticated push (HTTPS)                |

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