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

> Create a commit with staged changes

```python theme={null}
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.file.write("/home/user/repo/note.txt", "hello\n")
runtime.git.add("/home/user/repo", paths=["note.txt"])

r = runtime.git.commit(
    "/home/user/repo",
    "add note",
    author_name="Demo",
    author_email="demo@example.com",
)
print(r.success, r.stdout)

runtime.kill()
```

## Parameters

| Parameter         | Type    | Required | Description                                    |
| ----------------- | ------- | -------- | ---------------------------------------------- |
| `repository_path` | string  | Yes      | Path to the repository root inside the runtime |
| `message`         | string  | Yes      | Commit message                                 |
| `author_name`     | string  | No       | Author name for the commit                     |
| `author_email`    | string  | No       | Author email for the commit                    |
| `allow_empty`     | boolean | No       | Allow a commit with no changes                 |

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