> ## Documentation Index
> Fetch the complete documentation index at: https://docs.r28.ai/charter/llms.txt
> Use this file to discover all available pages before exploring further.

# git_commits_create

> Create a commit pointing at a tree. `parents` is required and is normally the branch's current head — an omitted `parents` is a root commit with no history, which the branch update afterwards then refuses. Nothing is visible until `git_refs_update` moves a branch onto the SHA this returns.

<div className="tool-route"><span className="tool-row-method" data-method="POST">POST</span><code>{"https://api.github.com/repos/{owner}/{repo}/git/commits"}</code></div>

```python github_git_commits_create.py theme={null}
from charter.packs import github

result = await github.git_commits_create.ainvoke({"owner": ..., "repo": ..., "message": ..., "tree": ...})
```

<Note>
  Requires `repo`, `read:user`.
</Note>

## Path parameters

<div className="reference-table">
  | Field                                                         | Type     | Description                                                                              |
  | ------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------- |
  | `owner` <span className="required" title="required">\*</span> | `string` | The account owner of the repository. The name is not case sensitive.                     |
  | `repo` <span className="required" title="required">\*</span>  | `string` | The name of the repository without the `.git` extension. The name is not case sensitive. |
</div>

## Body

<div className="reference-table">
  | Field                                                           | Type                                                                 | Description                                                                                                                                                                                                                                                                                           |
  | --------------------------------------------------------------- | -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `message` <span className="required" title="required">\*</span> | `string`                                                             | The commit message.                                                                                                                                                                                                                                                                                   |
  | `tree` <span className="required" title="required">\*</span>    | `string`                                                             | The SHA of the tree object this commit points to.                                                                                                                                                                                                                                                     |
  | `parents`                                                       | `string`\[]                                                          | The full SHAs of the commits that were the parents of this commit — normally one, the current head of the branch. For a merge commit, more than one. Required: an explicit empty list writes a root commit with no history, and omitting the field altogether is refused rather than treated as that. |
  | `author`                                                        | [GitCommitAuthor](/charter/charter/packs/github/git/objects#gitcommitauthor) | Information about the author of the commit. By default, the `author` will be the authenticated user and the current date.                                                                                                                                                                             |
  | `committer`                                                     | [GitCommitAuthor](/charter/charter/packs/github/git/objects#gitcommitauthor) | Information about the person who is making the commit. By default, `committer` will use the information set in `author`.                                                                                                                                                                              |
  | `signature`                                                     | `string`                                                             | The PGP signature of the commit, as an ASCII-armored detached signature. GitHub adds it to the `gpgsig` header of the created commit.                                                                                                                                                                 |
</div>
