How to Delete a GitHub Repository in 2024

September 19, 2024

GitHub is arguably the most popular tool for code collaboration. Its cloud-based platform allows developers to work together, share and store code in one central location. GitHub is based on Git, an open source version control system and allows developers to track changes to code over time.

In addition you can also use GitHub for bug tracking, task management and wikis for your projects.

In this guide, we will show you how to delete a GitHub repository and various other important points to consider along the way.

Before you delete a GitHub Repository

You can delete any GitHub repository, commonly known as a “repo” if you have administrator permissions for the repository or are the owner.

Warning! Deleting a repository is a permanent action on GitHub. Once deleted from GitHub it is not possible for GitHub to recover your data. The only way to recover deleted repositories is to use a third party GitHub backup solution such as BackupLABS.

If you delete a public repository, it will not delete any forks. However, if you delete a private repository, all forks will be deleted.

There are a number of things to consider before deleting a repository:

  • Archive: You can easily archive a repository. This will allow you to read and also fork the repository but you are unable to make any changes. If your reason for archiving is to free up disk space though, you are out of luck. Archiving does not free up space on GitHub.
  • Forking a repository: Forking allows you to create a copy of an existing repository. This fork shares code with the existing upstream repository, but is separate.
  • Cloning a repository: Cloning in GitHub repository will create a local copy on your computer. Any changes you do on the cloned repository will sync back to GitHub.
  • Backing up a repository: Using a third party backup provider such as BackupLABS will enable you to take automatic daily backups of repositories. If you accidentally delete a repository, you can restore back to GitHub in minutes.

How to Delete a GitHub Repository

Deleting GitHub repositories takes a few minutes to do. Let’s begin.

1. Log into your GitHub account and navigate to the repository you wish to delete

2. Click on Settings:

3. On the General area, scroll down to the bottom until you see Danger Zone.

4. Click Delete this repository:

5. Click I want to delete this repository

6. You will receive one final warning in a yellow box. Click I have read and understand these effects:

7. Lastly you will be asked to confirm deletion by typing in the name of the account and repository. Then click Delete this repository:

Thats it, your repository has now been permanently deleted.

Summary

Whilst deleting a repository is permanent on the GitHub platform itself, it is possible to still recover deleted repositories by using a third party GitHub backup service such as BackupLABS. A backup of a repository on BackupLABS enables users to restore deleted repositories back into GitHub in minutes.

Based on our research, the most common reason for data loss in GitHub is accidental deletion. Put simply, users are humans, and humans make mistakes. Other increasingly common reasons to recover data from GitHub are nefarious users/employees, bad software updates and viruses/malware. There have also been situations in the past where GitHub have been hacked themselves.

Protect your critical GitHub data today with a free trial of BackupLABS.