Contents:

Free Python Course ➞ Mini-course for beginners and experienced Coders. 4 cool projects for your portfolio, live communication with the speaker. Click and find out what you can learn in the course.
Learn MoreYou often need to clean up your GitHub profile by deleting unnecessary or accidentally created repositories. However, this process can seem complicated due to the peculiarities of the GitHub interface. In this article, we will look at three main methods for deleting repositories: through the web interface, using the command line, and using the GitHub desktop application. These methods will help you effectively manage your profile and keep your projects in order.
Deleting a Repository via the GitHub Website
Deleting GitHub repositories is an important step that should be performed with caution. The most effective way to delete a repository is through your user profile. To do this, log in to the GitHub website, go to your account settings, and select "Delete." You'll then be asked to confirm your intention to delete the repository. Let's go over this process in more detail to avoid potential errors and data loss.
To get started, log in to your GitHub profile and find the repository you want. The left panel displays all your created projects.

If you have a large number of repositories and you cannot find the one you need on the first page, click the button «Show more» or go to the «Your repositories» tab. This will allow you to view all your repositories and make it easier to find the project you need.

Now open the tab «Settings», which is located to the right of the «Analytics» tab.

Go to your repository settings and scroll down to the "Danger Zone" section. This section really requires caution, as it's possible to accidentally delete all your data or transfer ownership of the repository to another user. Note the last button—"Delete this repository." Use it with caution to avoid losing important information.

After clicking the "Delete this repository" button, A confirmation dialog box will open. This dialog box will ask you to confirm that you really want to delete the repository. Make sure you understand the consequences of deleting it, as it will be impossible to restore the repository after deleting it. Confirming deletion is important to prevent accidental actions and data loss.

To delete a repository, you must specify its full name, consisting of the name Your account and project name. In this example, it would be DavisWalkers/To_Delete. Enter it completely for successful deletion.

Now a button is available to permanently delete the repository - «I understand the consequences, delete this repository. After clicking this button, the project will be completely removed from your profile. When you click the button, you'll be redirected back to your profile, and a notification will soon appear informing you that the repository has been successfully deleted. Make sure you really want to delete the repository, as this action is irreversible.

Deleting a repository via the terminal
Command GitHub developers have concluded that deleting projects remotely via the terminal and third-party applications poses a security risk. Therefore, they have restricted such actions. Deleting a repository is possible, but this will only affect the local copy on your device, while the original will remain available on the GitHub platform.
To delete a project from your computer's memory, open a console and navigate to the repository directory using the cd command. Then, delete the .git subfolder using the rm -rf command in the Git console. This will completely delete all repository data, including the revision history. Be careful, as this will be impossible to recover.
The repository is now completely removed from your device. Let's look at how to perform the same operation in GitHub Desktop.
Deleting a Repository via GitHub Desktop
To delete a repository using the official desktop app, navigate to the desired repository, then right-click on the Current Repository tab and select Remove. This process allows you to quickly and efficiently clean up the list of repositories in the application, freeing up space and simplifying navigation.

Before deleting a repository, we You'll be prompted to confirm this action. You'll also be asked to move the repository to the trash. Make sure you have checked the appropriate checkbox and click the Delete button.

The repository has been successfully deleted. hard drive.
How to Restore a Deleted Repository
If you want to restore a deleted repository on GitHub, you have the option to do so under certain conditions. GitHub provides clear instructions on how to restore a deleted repository. However, please note that restoration is only possible if the repository was deleted recently and not a significant amount of time has passed since its deletion. Make sure you have access to the account from which the repository was deleted and follow the platform's recommendations for successful recovery.
- the data was deleted no more than 90 days ago;
- the deleted project was a branch of another repository that is not currently empty;
- did you realize you made a mistake when deleting the repository?
The second point is the most important. It can be reformulated as follows: your repository must have a parent repository. Otherwise, data recovery will be impossible.
First, go to the settings section.

Select the tab on the left «Repositories» and go to it.

Two tabs will be available on the page: «Repositories» and "Deleted repositories". Now let's move on to the second tab: "Deleted repositories".

In our case, the requirements were not met, which makes it impossible to restore the repository.

If everything is OK, you will be able to see a list of recently deleted repositories.

Click the "Restore" button, after which the following window appears:

To restore the repository, you need to click the «I understand» button and then select «restore this repository». After this, the recovery process will be complete.
Conclusions
- You can only delete a repository through the GitHub website. Locally, you can only delete a copy of the repository on your device.
- To delete a repository, you will need to confirm the operation. And be sure to think twice - maybe you shouldn't delete it after all.
- Not every repository can be restored - only those that have a non-empty parent repository and that were deleted in the last 90 days.
Reading is an important aspect of our lives. It contributes to the development of thinking, broadening our horizons and improving communication skills. Books, articles and other literature help us deepen our knowledge in various fields and understand the world around us. Pay attention to high-quality sources of information that will help you in self-development. It is important to choose materials that match your interests and goals in order to make the most of your reading time. Don't forget that regular reading helps improve concentration and memory.
- Instructions: Uploading a project to GitHub without the command line
- Test. Curse like Linus Torvalds
- What is GitHub and how to use it

