How to Delete a Repository on GitHub
After working on some coding projects for some time, your GitHub account might be flooded with repositories. Here's a short guide on how to delete a remote repository on GitHub.com.
The Git Cheat Sheet
No need to remember all those commands and parameters: get our popular "Git Cheat Sheet" - for free!
Things to Check before Deleting
Before you go and delete a repository, it makes sense to run through a little checklist:
1. Teamwork: you might not need the repository anymore, but in case you're working in a team, you should make sure that your teammates also don't need it anymore!
2. Permissions: do you have sufficient permissions to delete the repository? You should be either an organization owner or have admin permissions for the repository.
3. Sure? Lastly, double-check that you have the right repository and that you really want to get rid of it. When it's gone, it's gone! 😱
Deleting a Repository
When you've made the decision to delete, you should open the "Settings" page for the repository. There, scroll down all the way to the bottom and you'll find the button "Delete this repository".
Important Considerations Before Deleting
Deleting a repository is permanent and has the following effects:
- No Undo: Once deleted, issues, pull requests, wikis, and release attachments are lost forever
- Forked Repositories:
- Deleting a public repo does not delete any forks that already exist.
- Deleting a private repo removes all its forks.
- Permissions Required: Only users with "admin" or "owner" permissions can delete a repository.
If deleting seems too drastic, consider archiving it instead (details below).
Alternative: How to Archive a GitHub Repository
Instead of deleting, you can archive the repository. This removes it from active use but keeps it accessible for future reference.
How to Archive a Repository in GitHub
- Navigate to your repository’s main page.
- Click "Settings".
- In the main "General" view, scroll down to the "Danger Zone" section.
- Click "Archive this repository".
- Confirm by typing the repository name, then click "I understand the consequences, archive this repository".
Archived repositories are read-only but can be unarchived later.
Can a Deleted Repository Be Restored?
A deleted repository can be restored within 90 days, unless the repository was part of a fork network that is not currently empty.
You can learn more about this topic in GitHub’s repository restoration guide.
Frequently Asked Questions
What is deleted when I remove a GitHub repository?
- Public repos: Only the repository is deleted; forks remain.
- Private repos: The repository and all its forks are permanently deleted.
- Associated data: Issues, pull requests, and wikis are erased.
What if I only want to hide a repository but not delete it?
Use the archive option (explained above). This way, you can restore it in the future.
Can I delete a forked repository without affecting the original?
Yes, deleting a fork does not impact the original upstream repository.
Learn More
- More frequently asked questions about Git & version control