Deleting a repository removes it completely from GitHub, along with all its code, commit history, and issues
When you delete a GitHub repository, the entire project — every file, every commit, every pull request and issue — is gone. GitHub does not keep a backup you can recover from later. If you own the repository, you can delete it yourself in about two minutes. If you do not own it but have admin access, the same steps apply. If someone else owns it, you cannot delete it, but you can ask the owner to do so or remove yourself from the project.
Before you delete, check whether anyone else depends on the code. If other repositories import from yours, or if team members are still working in it, deletion will break their work. If you simply want to stop working on a project, you can archive it instead — it stays visible but marked as inactive, and you can unarchive it later if you change your mind.
Key Takeaways
- You can only delete a repository you own or have admin access to; the owner must delete it if you do not have those permissions.
- Deletion is permanent — GitHub does not keep backups, so make sure no one else is using the code before you proceed.
- The delete button is in the repository settings under the Danger Zone section, and GitHub will ask you to type the repository name to confirm.
- If you want to keep the code but stop maintaining it, archiving the repository is safer than deletion.
- After deletion, the repository URL will no longer work, and any forks of your repository will remain but will no longer be connected to the original.
Steps to delete a repository you own
Log into GitHub and open the repository you want to delete. Click the Settings tab near the top right of the repository page. Scroll down to the bottom of the settings page until you see a red section labeled Danger Zone.
In the Danger Zone section, click the red button that says Delete this repository. GitHub will open a dialog box asking you to confirm. The dialog will show the full name of the repository (your username slash the repository name) and ask you to type it exactly as shown. Type the repository name into the text field, then click the red Delete this repository button. The repository will be removed immediately.
What happens to forks and dependent projects after deletion
If other people have forked your repository, their forks will remain on GitHub after you delete the original. The forks will no longer show as connected to your repository — they become independent projects. Anyone who cloned your repository to their computer will still have a local copy of the code, but they will not be able to push changes back to GitHub or pull new updates from you.
If other repositories depend on your code — for example, if they import a package you published — those projects will break when you delete your repository. Before deletion, search GitHub for repositories that mention your project name, or check the Insights tab in your repository to see how many repositories depend on it. If the number is significant, consider archiving instead of deleting.
Archiving instead of deleting
Archiving a repository is a safer alternative if you are unsure about deletion. An archived repository stays visible on GitHub and in search results, but it is marked as inactive. You can still view the code and history, but no one can push new commits or open new issues. If you change your mind later, you can unarchive the repository in the same Danger Zone section of settings.
To archive a repository, go to Settings, scroll to the Danger Zone, and click Archive this repository. GitHub will ask you to confirm by typing the repository name. After archiving, the repository page will display an Archived banner at the top. Archiving is useful if you want to preserve the code for reference but signal to others that you are no longer maintaining it.
If you do not have permission to delete
If you are a collaborator on a repository but not the owner, you will not see the delete option in Settings. Only the repository owner or someone with admin access can delete it. If you want the repository deleted, contact the owner and ask them to do so. If you simply want to leave the project, you can remove yourself by going to Settings and clicking the Members section, then clicking the X next to your own name.
If you are the owner but the repository belongs to an organization, you may need additional permissions. Organization owners can set rules about who can delete repositories. Check with your organization's admin if you do not see the delete option.
Recovering a deleted repository
GitHub does not restore deleted repositories. Once you click the final confirmation button, the repository and all its history are gone. If you deleted a repository by mistake, your only option is to recreate it from a local backup if you have one. If you cloned the repository to your computer before deletion, you can push it back to GitHub as a new repository, but the original URL and all associated metadata will be lost.
To prevent accidental deletion, consider making your repository private before deleting it, or transferring ownership to someone else if you want the project to continue under different management. Some teams use branch protection rules or require multiple approvals for sensitive actions, though GitHub does not currently require approval for repository deletion.
Frequently Asked Questions
Can I delete a repository if I am not the owner?
No. Only the repository owner or someone with admin access can delete it. If you have write access but not admin access, you cannot delete the repository. Contact the owner and ask them to delete it, or ask to be removed from the project if you no longer want to work on it.
Will deleting my repository affect the forks other people made?
No. Forks remain on GitHub after you delete the original repository. They become independent projects and will no longer show as connected to yours. People who forked your code keep their copies, but they cannot pull updates from you anymore.
What if I delete a repository by mistake?
GitHub does not restore deleted repositories. If you have a local clone on your computer, you can push it back to GitHub as a new repository. Otherwise, the code is gone. This is why archiving is safer than deleting if you are unsure.
Can I delete a repository that belongs to an organization?
It depends on your permissions within the organization. Organization owners can set rules about who can delete repositories. If you do not see the delete option in Settings, contact your organization admin to ask for permission or to delete it for you.
What is the difference between deleting and archiving?
Archiving keeps the repository visible and readable but marks it as inactive. Deleting removes it completely. You can unarchive a repository later, but you cannot recover a deleted one. Archive if you want to preserve the code for reference; delete only if you are certain you will never need it again.