Do you have an old project on GitHub that’s no longer active or needed? Deleting old repositories (repo) cleans up your account for any potential future employers looking at your code. Here’s how it’s done.
What You Need to Know Before Deleting a GitHub Repository
You can delete a repo at any time if you’re the organization owner or have admin rights. When a repo is deleted, you can sometimes restore it under certain conditions. However, there are still some serious consequences that occur when deleting a repo—even if you manage to recover it.
Deleting a private repository also deletes all forks (online copies) of that repo. However, if you delete a public repo, the forks will still exist.
Note: If a repo is public and is later changed to private, the forks that were made when the repo was public won’t be deleted. You decide whether you want the repo to be public or private when you create the repo, so just keep in mind that there may still be some information hanging around for the public even if you switch the repo to private and later delete it.
Removing a repository will also delete any associated issues, attachments, team permissions, and comments. If you think you may need to reference some of this material in the future, don’t delete the repo, as this can’t be undone.
How to Delete a GitHub Repository
If you’re sure that you want to delete your repository, open the GitHub website in your browser of choice and log in to your account. Next, click the repo that you want to delete in the “Repositories” group in the left-hand pane.
Select the “Settings” button under the repo’s analytics.
Now scroll to the bottom of the Settings page until you see the Danger Zone section. Here, click “Delete This Repository.”
A pop-up message will appear warning you that the action is permanent and prompting you to type the repo name to confirm. Read the warning carefully, type your repo name in the text box, and then click “I understand the consequences, delete this repository.”
The GitHub repository will be deleted.