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

# pulls_update_branch

> Bring a pull request's branch up to date by merging the base branch into it — the fix for a 'this branch is out of date' block. The 202 means the job was accepted, not that the branch has moved; read the pull request again to confirm. Pass `expected_head_sha` to refuse if it has moved since you looked.

<div className="tool-route"><span className="tool-row-method" data-method="PUT">PUT</span><code>{"https://api.github.com/repos/{owner}/{repo}/pulls/{pullNumber}/update-branch"}</code></div>

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

result = await github.pulls_update_branch.ainvoke({"owner": ..., "repo": ..., "pullNumber": ...})
```

<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. |
  | `pullNumber` <span className="required" title="required">\*</span> | `integer` | The number that identifies the pull request.                                             |
</div>

## Body

<div className="reference-table">
  | Field             | Type     | Description                                                                                                                                                                       |
  | ----------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `expectedHeadSha` | `string` | The expected SHA of the pull request's HEAD ref — its most recent commit. If it does not match, GitHub answers 422 rather than updating a branch that has moved since you looked. |
</div>
