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

> Point a branch or tag at a different commit — the step that makes a commit built with `git_trees_create` and `git_commits_create` visible. Refuses a non-fast-forward unless `force` is set, which is what stops this overwriting work you have not seen.

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

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

result = await github.git_refs_update.ainvoke({"owner": ..., "repo": ..., "ref": ..., "sha": ...})
```

<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.                    |
  | `ref` <span className="required" title="required">\*</span>   | `string` | The Git reference to move, formatted as `heads/BRANCH_NAME` or `tags/TAG_NAME`. Without the `refs/` prefix. |
</div>

## Body

<div className="reference-table">
  | Field                                                       | Type      | Description                                                                                                                                                                      |
  | ----------------------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `sha` <span className="required" title="required">\*</span> | `string`  | The SHA1 value to set this reference to.                                                                                                                                         |
  | `force`                                                     | `boolean` | Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this out or setting it to `false` will make sure you're not overwriting work. |
</div>
