Skip to content
Source
Sign inSign up

Archive a repository

Code and repositories / Repository settings

Archive a repository

The work on a repository is done, and it must stay as it is. Archive it: everyone still reads and clones it, and nobody pushes to it or comments on it.

2 min read

You need to be an admin of the repository.

1. Open the Danger zone

Open the repository, then Settings. In the sidebar, click Danger zone.

2. Archive it

Click Archive. In the dialog, click Archive repository.

Archive it in a terminal

src repo archive acme/old --yes
src repo unarchive acme/old --yes

Done

The repository page shows This repository is archived, and its name has the label Archived. The repository is read-only for everyone:

  • Nobody can push.
  • Nobody can open issues or pull requests, or comment on them.
  • No CI run and no factory run starts.
  • A write gets the error "This repository was archived so it is read-only."

Everyone who can read it still reads and clones it. Admins still see everything that they saw before, such as the held queue, the CI secrets and the hidden workflows. Admins can still change its settings, rename it, unarchive it and delete it.

Unarchive it

In Danger zone, click Unarchive. In the dialog, click Unarchive repository. Pushes, issues, pull requests, comments, CI runs and factory runs work again.

To remove a repository for good, see Delete a repository.

With REST or MCP

PUT /api/v1/repos/{owner}/{repo}/archive archives the repository. DELETE on the same path unarchives it. The MCP tool is archive_repo.