To delete a GitHub repository, open the repository, go to Settings, scroll to the Danger Zone and click Delete this repository, then type the repository name to confirm. You need admin permission on the repository (or to be an organization owner), and some deleted repositories can be restored within 90 days.
Delete a repository on github.com
- Go to the repository's main page on GitHub.
- Under the repository name, click Settings. If you don't see it, open the More dropdown (the three dots) and click Settings.
- On the General page, scroll to the Danger Zone section and click Delete this repository.
- Click I want to delete this repository.
- Read the warnings and click I have read and understand these effects.
- Type the repository's name in the text box.
- Click Delete this repository.
The same steps delete a fork. Deleting a fork does not touch the upstream repository it came from.
Who is allowed to delete a repository
You must be an organization owner, or have admin permission on the repository or fork. Even then, an organization or enterprise policy may block deletion. If the Delete this repository button is missing or fails, that policy is the first thing to check, and an organization owner can look at it.
Delete a repository with the GitHub CLI
The gh command line tool can do it without opening the browser:
gh repo delete owner/repo --yes
--yes skips the confirmation prompt. Without it, gh asks you to confirm. Deleting needs the delete_repo scope on your token, which is not granted by default. If it is missing, add it:
gh auth refresh -s delete_repo
If you run gh repo delete with no repository name, it targets the repository in the current folder. In that case --yes is ignored and you are still prompted. To skip the prompt, name the repository explicitly.
What happens to forks and permissions
| You delete | Result |
|---|---|
| A private repository | All of its forks are deleted too |
| A public repository | Its forks are not deleted |
| A fork | The upstream repository is not deleted |
Team permissions for the repository are permanently deleted, and that part can't be undone, even if you restore the repository later.
Restore a deleted repository
GitHub's documentation says some deleted repositories can be restored within 90 days of deletion. It can take up to an hour after deletion before the repository is available to restore. As of November 2026, the steps differ by owner.
Repository owned by your personal account
- Click your profile picture in the upper-right corner, then click Settings.
- In the sidebar, click Repositories.
- Click Deleted repositories.
- Next to the repository, click Restore.
- Read the warning, then click I understand, restore this repository.
Repository owned by an organization
- Click your profile picture, then click Organizations, then click the organization.
- Under the organization name, click Settings (or use the More menu if you don't see it).
- In the left sidebar, click Deleted repositories.
- Next to the repository, click Restore.
- Read the warning, then click I understand, restore this repository.
One limit to know about: if the repository was part of a fork network that still has other repositories in it, you can't restore it yourself. Every other repository in the network must be deleted or detached first, otherwise you have to contact GitHub Support. Per the documentation, only paid GitHub plans can ask Support to restore a repository.
Archive instead of deleting
If you only want to stop working on a project, archiving may be enough. An archived repository becomes read-only: nobody can push commits or open new issues and pull requests, but the code stays visible and can be cloned. You can archive it from the same Danger Zone section in Settings, and you can unarchive it later. That makes it a reversible choice, which deletion is not always.
Back up a repository before deleting it
A mirror clone copies every branch, tag and ref, so it is a more complete backup than a normal clone:
git clone --mirror https://github.com/owner/repo.git
This creates a repo.git folder. If you ever need to publish the code again, create a new empty repository and push the mirror to it with git push --mirror. Note that a Git clone holds the code and history only. Issues, pull request discussions, wikis and repository settings are not part of it, so export or copy anything you need from those separately.
Before you delete
- Keep a copy. Restoring is not guaranteed, so if you might want the code later, clone it first with
git clone --mirrorto keep every branch and tag. - Check the forks. If the repository is private, its forks go with it.
- Check who depends on it. Anyone cloning, linking to or installing from the repository will get an error once it is gone.
Frequently asked questions
- Why can't I see the Delete this repository button?
- You need to be an organization owner or have admin permission on the repository. An organization or enterprise policy can also block deletion even for people who have those permissions. Ask an organization owner to check the policy or to delete it for you.
- Can I get a deleted GitHub repository back?
- Some deleted repositories can be restored within 90 days of deletion, from Settings, then Deleted repositories. It can take up to an hour after deletion before the repository shows up there. Team permissions are not restored.
- Does deleting a repository delete its forks?
- It depends on visibility. Deleting a private repository also deletes all of its forks. Deleting a public repository does not delete its forks. Deleting a fork never deletes the upstream repository.
- How do I delete a repository from the command line?
- Use the GitHub CLI: gh repo delete owner/repo --yes. Your token needs the delete_repo scope, which you can add with gh auth refresh -s delete_repo.