Creating new GitHub repositories can get pretty addictive. But if you find yourself with one too many repositories and want to simplify your profile, here's how to delete a repository in GitHub.
First, the short version. (Keep scrolling for the detailed steps and important things to keep in mind before permanently deleting a GitHub repository.)
Go to the main page of the repository you want to delete.
Under your repository name, click Settings.
In the Danger Zone section, click Delete this repository.
A series of pop-ups will appear asking if you want to delete your repository. Click the confirmation buttons, and you're all set.
What to know before you delete a repository on GitHub
Only GitHub members with owner privileges for an organization or admin permissions for a repository can delete an organization repository or fork (a copy of someone else's repository). But before you hit delete, here are some important things to keep in mind:
Deleting a public repository will not delete any forks of the repository.
Deleting a private repository will delete all associated forks.
Deleting a repository (public and private) will remove all wikis, issues, and comments associated with the repository.
Deleting a fork doesn't affect the upstream (original) repository.
With a few exceptions, there is no way to restore a deleted repository.
If you're not sure about permanently deleting your GitHub repo, a safer bet is to archive it. This way, you can unarchive it later on and pick up where you left off.
How to delete a repository in GitHub
Log in to your GitHub account.
Click your profile icon, and then select Your repositories.
From your Repositories page, click the repository you want to delete. This will bring you to the main page for your selected repository.
Click the Settings tab (under your repository name).
In the Danger Zone section, click Delete this repository.
You'll receive a series of pop-ups asking you to confirm that you're really sure you want to delete your repository.
Click I want to delete this repository.
Click I've read and understand these effects.
Enter
[your account name]/[name of your repository]
(for example,jumuir/new-test-repo
). Then click Delete this repository.
That's it! A banner will appear at the top of your Repositories page to confirm that your repo was successfully deleted.
How to archive a GitHub repository
If you don't want to permanently delete all your data, here's how to archive a GitHub repository instead.
Click your profile icon, and then select Your repositories.
From your Repositories page, click the repository you want to delete. This will bring you to the main page for your selected repository.
Click the Settings tab (under your repository name).
In the Danger Zone section, click Archive this repository.
In the pop-up window that appears, enter
[your account name]/[name of your repository]
(for example,jumuir/new-test-repo
). Then click I understand the consequences, archive this repository.
This will put your repository into read-only mode, but other users will still be able to fork it. If you want to bring the repo back to life, go to its Settings page and click Unarchive this repository. It'll then reappear on your Repositories page.
GitHub repository FAQ
Turns out people have lots of questions about GitHub repositories—like "Why is it so hard to say 'repository'?" Is that just me? Anyway. Here are answers to the most common questions.
What is a GitHub repository?
A GitHub repository (or "repo") contains an entire coding project. It's a central place in GitHub where you can store and manage your project files or share them with others. Coders create repositories to track project changes and allow others to view, edit, or modify their work.
What does it mean to fork a repository in GitHub?
Forking means copying code. If you share your code publicly on GitHub, other coders can either contribute directly to the original code or copy (aka "fork") the code into their own repository.
Related reading:
This article was originally published in June 2019 by Khamosh Pathak. The most recent update was in October 2023.