dseven labs

How to archive a Bitbucket repository

Last updated 28 November 2026

Bitbucket Cloud has no archive button. You can get the same result by making the repository read-only and labelling it.

If you need the short version: add branch restrictions on every branch of the repository so nobody can push, force-push, delete a branch or merge, then put ARCHIVED at the start of the description. You need admin rights on the repository. Nothing is deleted and you can reverse it.

Do it by hand

  1. Open the repository and go to Repository settings, then Branch restrictions.
  2. Add rules for the branch pattern * that block pushes, history rewrites (force pushes) and branch deletion.
  3. Stop merges into the repository. Anyone with admin access can remove a branch rule, so for repositories that matter, add a required merge check as well.
  4. In Repository details, start the description with ARCHIVED so people see it in lists and search.
  5. If you keep a project for old repositories, move it there.
  6. Write down what you changed. To unarchive, remove the rules and the prefix.

Finding repositories to archive

Bitbucket does not show how long a repository has been idle. Sort the workspace list by last updated, then open each candidate and look for recent pushes and open pull requests. Many teams use 180 or 365 days without a push as the cut-off. Check for open pull requests first, because archiving a repository with active reviews will surprise people.

Doing it in one click

Repo Gardener for Bitbucket runs those steps for you. It makes the repository read-only on every branch, adds the ARCHIVED prefix, saves what it replaced so unarchive can restore it, and lists repositories with no push in 90, 180 or 365 days, each with an Archive button. The data stays in Forge storage and the app has no separate server.

It has limits. It relies on branch restrictions, not a native flag, so tags, pull request comments and the wiki can still change. Our guide to repository templates covers the other thing Bitbucket lacks.

Questions

Can you archive a repository in Bitbucket Cloud?

There is no archive switch. Teams get the same effect by adding branch restrictions that block changes, putting a label in the description, and sometimes moving the repository to a separate project.

Does archiving delete the repository or its history?

No. Archiving here only blocks changes. Code, commits, branches and pull requests stay where they are, and removing the restrictions undoes it.

How do I stop people pushing to an old Bitbucket repository?

Under Repository settings, Branch restrictions, add rules for the pattern * that block pushes, force pushes and branch deletion, and stop merges.

Can I list repositories by last activity?

Bitbucket sorts the workspace repository list by last updated, which gets you a rough list. For a list of repositories with no push in 90, 180 or 365 days you need a tool or a script against the API.

Does Repo Gardener for Bitbucket do this for me?

Yes. It is an Atlassian Forge app from dseven labs. One click applies the restrictions and adds an ARCHIVED prefix to the description, and unarchive puts everything back. It also lists stale repositories. It uses branch restrictions rather than a native flag, so tags, comments and the wiki stay editable.