A Step-by-Step Guide to Deleting a Repository on GitHub
Tags: github
Published: 2024-01-10 08:01:00

GitHub is a great version control platform, which helps you store your code for later use or collaborative needs. 

If you find yourself needing to delete a repository, whether it's to declutter your profile or start fresh, this guide will walk you through the simple steps to permanently remove a repository on GitHub.

💡 If you'd prefer to follow a video tutorial you can do by clicking on the video below. 

{% youtube 2lAiHlXTY0s %}

Step 1: Navigate to Your Repository
To get started, log in to your GitHub account and navigate to the repository you want to delete. Once you're on the repository's main page, look for the "Settings" tab on the right side of the menu bar. Click on it to access the repository settings.

![GitHub settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zopxzdhglr17hxgtnpmg.png)

## Step 2: Scroll Down to the Danger Zone
Within the Settings page, scroll down until you find the "Danger Zone" section. GitHub intentionally labels this section to emphasize the irreversible actions you are about to take. In the Danger Zone, locate the "Delete this repository" option.

## Step 3: Confirm Repository Deletion
Before proceeding, GitHub requires you to confirm your intention to delete the repository. Click on the “I want to delete this repository” button. 

![GitHub repository danger zone](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/268mxufwtjxk59l2e5ed.png)


## Step 4: Double-check
GitHub will prompt you to double-check if you want to delete this repository, it will remind you that deleting the repository removes all code, wiki, issues, comments, packages, secrets, workflow runs and collaborator associates. 

If you wish to proceed click on the “I have read and understand these effects” button. 

![GitHub delete repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wajzsqcqabv5o6m0a5wt.png)

## Step 5: Confirm the name of the repository
To finalize the deletion process, GitHub requires you to enter the name of the respiratory manually. This is an added security measure to prevent unauthorized deletions. After entering your repository name, click on the "Delete this repository" button.

![GitHub delete repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ugbyxy6fz8aym4a6v08r.png)


Step 6: Repository Deleted Confirmation
Congratulations! You've successfully deleted your GitHub repository. GitHub will provide a confirmation message to let you know that the repository has been deleted. Additionally, you'll be redirected to your account's main page.


![GitHub delete repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bf1spclmswtw0vnxa8zj.png)

## Step 7: Update Local Repositories (Optional)
If you have a local clone of the repository on your computer, you may want to update it to reflect the changes on the remote GitHub server. Use the following Git command in your terminal or command prompt:

```bash
git remote update --prune
```

This ensures that your local repository is synchronized with the changes made on GitHub.

## Conclusion

Deleting a repository on GitHub is a straightforward process, but it's crucial to approach it with caution due to its irreversible nature. Always double-check for any dependencies and ensure you've backed up essential data before proceeding. With this step-by-step guide, you can confidently manage and declutter your GitHub profile by removing repositories that are no longer needed.