> Canonical HTML: [https://docs.schematic.rs/commands/repos/](https://docs.schematic.rs/commands/repos/)

# Repository commands

Link a local Git repository once before its first check. Pup prepares its current commit for Schematic and watches for later commits in the background.

## `pup repo link`

Link a Git repository to Schematic:

**Usage**

```console
pup repo link [path]
```

`path` defaults to the current directory.

**Terminal**

```console
$ pup repo link .
● text-tools · main@a81d7c2 · preparing 12%
```

Pup records the local association and begins preparing eligible source from the current commit. Preparation continues in the background after the command exits. Linking gives Pup permission to send that source to Schematic. It does not push to a Git remote or change your repository.

### Link an existing repository again

Running `pup repo link` for an already linked repository is safe. Pup keeps the existing association and prepares its current commit instead of creating a duplicate.

If you previously unlinked the same worktree, linking it again reconnects its existing checks and history.

### Linked repository paths

Running a command from a child directory uses the nearest linked repository. A separate clone or checkout in another directory must be linked separately.

### Exit behavior

Exit status `0` means the repository is linked and preparation has started. Use `pup repo status` to check its progress.

`pup repo link` has no `--wait` option. You can run `pup check` immediately: checks remain Pending until preparation finishes, and `pup check --wait` stays attached through both preparation and checking.

Read [Source and commits](/help/source/) for file eligibility, temporary Pup commits, and the information sent to Schematic.

## `pup repo status`

Inspect the repository associated with the current directory or another local path:

**Usage**

```console
pup repo status [path]
```

**Terminal**

```console
$ pup repo status
● text-tools · main@a81d7c2 · preparing 68%
```

When the checked-out commit is available for new checks:

**Terminal**

```console
$ pup repo status
✓ text-tools · main@a81d7c2 · ready
```

Pass another linked repository path to inspect it from elsewhere:

**Terminal**

```console
$ pup repo status /work/text-tools
```

### Repository states

| State       | Meaning                                                                                 |
| ----------- | --------------------------------------------------------------------------------------- |
| `Preparing` | Pup is discovering, transferring, retrying, or preparing the checked-out commit.        |
| `Ready`     | The displayed commit is available for new checks.                                       |
| `Error`     | Preparation cannot continue without action. Pup prints the reason and a suggested step. |

Progress is approximate and applies to the displayed commit. If `HEAD` moves again, Pup begins preparing the new commit and reports its progress instead.

## `pup repo unlink`

Stop watching a local repository:

**Usage**

```console
pup repo unlink [path]
```

`path` defaults to the repository associated with the current directory.

**Terminal**

```console
$ pup repo unlink .
✓ Unlinked · text-tools
```

Unlinking removes the local association and stops preparing later commits. It does not delete source, checks, Problems, or results stored by Schematic. It also leaves local temporary Pup commits available through Git.

A check whose commit is already available can continue after unlinking. A check still waiting for unsent source cannot continue and reports an operational error.
