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

# repos.update()

> Rename a repository, change its default bookmark, or update upstream configuration.

Update fields on a repository. Omitted keyword arguments are left unchanged.

**Required scope: `write`**

```python theme={null}
repo = await mesa.repos.update(
    repo="app",
    name="renamed-app",
    default_bookmark="main",
)
```

Update upstream credentials without changing other repository fields:

```python theme={null}
from mesa_sdk.types import TokenAuth, UpstreamConfig

repo = await mesa.repos.update(
    repo="app",
    upstream=UpstreamConfig(
        url="https://github.com/acme/app.git",
        auth=TokenAuth(token="github_pat_..."),
    ),
)
```

## Options

<ParamField path="repo" type="str" required>
  Repository name to update.
</ParamField>

<ParamField path="org" type="str | None">
  Organization override.
</ParamField>

<ParamField path="name" type="str | None">
  New repository name.
</ParamField>

<ParamField path="default_bookmark" type="str | None">
  New default bookmark name.
</ParamField>

<ParamField path="upstream" type="UpstreamConfig | None | Unset">
  Omit to leave upstream unchanged. Pass `None` to remove the upstream entirely. Pass `UpstreamConfig` to set or replace the upstream URL.
</ParamField>

## Upstream auth tri-state

`UpstreamConfig.auth` has different meanings on update:

| Value                                 | Behavior                                                        |
| ------------------------------------- | --------------------------------------------------------------- |
| omitted / `UNSET`                     | Preserve the existing stored credential while updating the URL. |
| `None`                                | Clear the stored credential and make the upstream public.       |
| `TokenAuth` or `UsernamePasswordAuth` | Replace the stored credential.                                  |

## Response

<ResponseField name="id" type="str">
  Repository ID.
</ResponseField>

<ResponseField name="org" type="str">
  Organization slug.
</ResponseField>

<ResponseField name="name" type="str">
  Repository name.
</ResponseField>

<ResponseField name="default_bookmark" type="str">
  Default bookmark name.
</ResponseField>

<ResponseField name="head_change_id" type="str">
  Current change ID at the default bookmark tip.
</ResponseField>

<ResponseField name="upstream" type="UpstreamConfig | None">
  Configured upstream remote, or null when no upstream is configured.
</ResponseField>

<ResponseField name="created_at" type="datetime">
  Creation time.
</ResponseField>

<ResponseField name="tags" type="dict[str, str]">
  Repository tags.
</ResponseField>

### UpstreamConfig

<ResponseField name="url" type="str">
  Upstream Git remote URL.
</ResponseField>

<ResponseField name="auth_kind" type="'token' | 'username_password' | None">
  Stored upstream authentication kind, or null when the upstream is public.
</ResponseField>
