Deleting a repo takes three steps: confirm you have admin access, navigate to the repo settings, and choose the delete option

To delete a repository from GitHub, you need admin permissions on that repo. If you own it, you have admin access automatically. If someone else owns it, they must grant you admin rights first, or you cannot delete it. Once you have admin access, go to the repo's Settings tab, scroll to the Danger Zone section at the bottom, and click Delete This Repository. GitHub will ask you to type the repo name to confirm — this prevents accidental deletion.

The deletion is permanent. GitHub does not keep a recoverable copy after you confirm. If you think you might need the code later, download it or create a backup branch in another repo before you delete.

Key Takeaways

  • Only someone with admin access to the repo can delete it; if you do not own the repo, ask the owner to make you an admin first.
  • The delete button is in Settings under the Danger Zone section, and GitHub requires you to type the repo name to confirm the deletion.
  • Deletion is permanent and cannot be undone, so download or back up the code if you might need it later.
  • If the repo is part of an organization, organization owners can delete it even if they are not the repo admin.

How to check if you have admin access

Open the repo on GitHub and look at the top navigation. Click Settings. If the Settings tab appears and you can click it, you have at least admin access. If Settings is grayed out or missing, you do not have permission to delete the repo.

If you do not have admin access and the repo belongs to someone else, contact the repo owner and ask them to make you an admin. They can do this by going to Settings, clicking Collaborators, finding your username, and changing your role from Contributor to Admin.

Step-by-step deletion process

Start by opening the repo you want to delete. Click the Settings tab near the top right of the page. Scroll all the way to the bottom of the Settings page. You will see a red section labeled Danger Zone — this is where destructive actions live.

In the Danger Zone, click the red Delete This Repository button. GitHub will open a dialog box asking you to confirm. Type the exact name of the repo (for example, if the repo is called my-project, type my-project). Click the red Delete This Repository button in the dialog. The repo is now deleted.

What happens after you delete a repo

The repo disappears from your GitHub profile immediately. Anyone who had a link to it will see a 404 error. If other people have cloned the repo to their computers, their local copies remain — deletion only removes it from GitHub's servers, not from computers where it was already downloaded.

If you pushed code to that repo from your computer, your local git history still contains all the commits. You can create a new repo and push that history there if you change your mind, but you cannot recover the original GitHub repo itself.

Deleting a repo you do not own

If the repo belongs to someone else and you have admin access (because they made you a collaborator with admin rights), you can delete it using the same process. However, this is unusual — most people only give admin access to people they trust completely.

If you are an organization member and the repo belongs to the organization, organization owners can delete it from the organization settings even if they are not the repo admin. This is a separate permission level that applies to the whole organization, not individual repos.

Alternatives to deletion

If you want to keep the code but stop working on it, consider making the repo private instead of deleting it. Go to Settings, scroll to the Danger Zone, and click Change Repository Visibility. Choose Private. This hides the repo from public view but keeps all the code and history intact.

Another option is to archive the repo. Click Settings, scroll to the Danger Zone, and click Archive This Repository. An archived repo is read-only — no one can push new code to it, but the history remains visible and downloadable. This signals that the project is no longer active without erasing it.

Frequently Asked Questions

Can I recover a repo after I delete it?

No. GitHub does not keep deleted repos in a trash folder or recovery system. Deletion is permanent. If you need the code back, you must restore it from a local clone on your computer or from a backup you created before deletion.

What if I delete a repo by accident?

Contact GitHub Support as soon as possible. They may be able to recover it if you reach out within a short window, but there is no may provide. This is why GitHub requires you to type the repo name before deletion — it is meant to prevent accidental clicks.

Can I delete a repo if I am not the owner?

Only if the owner made you an admin on that repo. If you have admin access, you can delete it. If you do not have admin access, ask the owner to either make you an admin or delete it themselves.

Does deleting a repo delete it from my computer?

No. Deleting a repo on GitHub only removes it from GitHub's servers. Any clones on your computer remain untouched. Your local git history, branches, and commits are still there.

What is the difference between deleting and archiving a repo?

Deleting removes the repo completely and permanently. Archiving keeps the repo visible and downloadable but makes it read-only — no one can push new code to it. Archive a repo if you want to preserve the history but signal that the project is inactive.