# Mirroring

> Keep a read-only copy of your repository on GitHub, updated on every push to Sypnia Git.

Applies to: Sypnia Cloud (paid service).  
Source: https://git.docs.sypnia.com/migrate/mirroring/

For agents: Mirrors go one way: Sypnia Git → GitHub. Work happens in Sypnia Git; the GitHub copy is read-only. `npx @sypnia/git mirror github owner/repo` sets it up (Sypnia GitHub App with write access to that repository only); every push to Sypnia Git pushes the changed branches, tags and LFS objects to GitHub. Nothing comes back: a commit pushed straight to GitHub, or a pull request opened there, is not brought into Sypnia Git, and the next update overwrites that branch. Protect the branches on GitHub so only the Sypnia GitHub App can push. Issues and pull requests are not mirrored (only moved at import/export). `--stop` ends the mirror and leaves the GitHub copy as it is. sypnia.toml: [git] mirror.github.

A mirror keeps a **read-only copy** of your repository on GitHub. Your work happens in Sypnia Git: people and agents push there, pull requests are reviewed there, and the GitHub copy follows. It is useful when people outside should find your open-source code on GitHub, or when a tool you use only reads from GitHub.

```bash
npx @sypnia/git mirror github laespiga/web
```

The command asks you to install the Sypnia GitHub App on that GitHub repository, with permission to write to it and nothing else, and records the mirror in the `[git]` table of [`sypnia.toml`](https://git.docs.sypnia.com/migrate/sypnia-toml).

## What moves

- **On every push to Sypnia Git**, the branches, tags and LFS objects that changed are pushed to GitHub, usually within seconds.
- **Nothing comes back.** A commit pushed straight to GitHub, or a pull request opened there, is not brought into Sypnia Git, and the next update from Sypnia overwrites that branch on GitHub. Protect the branches on GitHub so that only the Sypnia GitHub App can push to them.
- **Code only.** Issues and pull requests are not mirrored. They move once, when you [import](https://git.docs.sypnia.com/migrate/from-github) or [export](https://git.docs.sypnia.com/migrate/to-github).

## Stop a mirror

```bash
npx @sypnia/git mirror github laespiga/web --stop
```

The GitHub copy stays as it was at the last update; nothing is deleted on either side.
