• Get application security done the right way! Detect, Protect, Monitor, Accelerate, and more…
  • Organizing things is as important as real work. It helps you to manage things easily.

    Suppose you are working on a project and created some folders and files to work. And later decided that they are not necessary for the current project. But you didn’t remove them for some reason.

    What happens shortly?

    Nothing. It just becomes a big mess for you.

    So, the importance of organizing should be one of ours top skills. Here, we will make sure our GitHub account is clean by deleting the unused repositories from our accounts.

    There might be different approaches to do a task. But, here, we have only one way to delete the GitHub repository. We are going to see it in detail.

    Let’s get started without further ado.

    Deleting a Repository

    Don’t get confused. GitHub web app is nothing but the website. Technically, it’s a web application, not a website. But, most of us get used to the word website—a new technical thing for those who don’t know about it.

    Anyway, let’s go to our main topic of deleting a repository in GitHub.

    • Go to the GitHub.
    • Log in to your account.
    • Search for the repository that you want to delete from your account.
    Search Repository
    Search Repository
    • Click the repository from the result and open it.
    GitHub Repository
    GitHub Repository
    • Click on the Settings button from the top navbar.
    Repository Settings Button
    Repository Settings Button
    • It’ll navigate you to the settings page of the current repository.
    Repository Settings
    Repository Settings
    • Scroll down to the end of the settings, where you’ll find a section called Danger Zone.
    Repository Danger Zone
    Repository Danger Zone
    • There is an option called Delete this repository at the end. And that’s the only option we are interested in right now.
    • Click on the button Delete this repository.
    Delete Repository Button
    Delete Repository Button
    • GitHub asks us to make sure about deleting the repository with a warning message (read it). And also asks us to confirm it by typing the repository path.
    Delete Repository Confirmation with Warning Message
    Delete Repository Confirmation with Warning Message
    • Enter the repository path in the input box as shown. We can copy the repository path that’s shown in the warning message to speed up the process.
    Delete Repository Confirmation
    Delete Repository Confirmation
    • Click the button. I understand the consequences, delete this repository to delete the repository.
    • It’ll redirect us to the GitHub home page after deletion and shows a success message as follows.
    Delete Repository Success Message
    Delete Repository Success Message

    Finally, we have deleted the GitHub repository.

    Is there any other way to delete GitHub repository?

    Unfortunately, not that I am aware of. There’s no other way to delete a GitHub repository as of now.

    Restoring a Repository

    What if you deleted a repository by mistake? Is there a chance to get it back?

    Yeah, we can restore the repository with some exceptions. Let’s see how to restore our deleted GitHub repository.

    There are two instances where we can’t restore the repository.

    • The number of days deleted repository exceeds 90 days.
    • If the repository is part of the fork network until all other repositories are deleted.

    Let’s see the steps to restore a repository.

    • Go to settings in your GitHub account.
    GitHub Settings
    GitHub Settings
    Settings Button
    Settings Button
    • Click on the Repositories button from the left navbar.
    GitHub Repositories
    GitHub Repositories
    Repositories Button
    Repositories Button
    • You will navigate to the repositories page as follows.
    Repositories
    Repositories
    • Click on the Deleted repositories button from the Repositories section.
    Deleted Repositories Button
    Deleted Repositories Button
    • You will see all your deleted repositories as follows.
    Deleted Repositories
    Deleted Repositories
    • Read the info message in the above pic. As they mention, it may take an hour to show our deleted repositories in the section.
    • Once your repository is shown in the Deleted repositories section, you can restore it.
    • You will find a Restore button at the end of the repository item, as shown below.
    GitHub Restore Button
    GitHub Restore Button
    • Click the restore button.
    • GitHub will show us a modal with a message what will be restored.
    Restore Dialog
    Restore Dialog
    • Read the message.
    • Click on the I understand, restore this repository for confirmation.
    • It’ll show Done! message as follows.

    Done

    Go to the home page and search for the repository. There you go, you will find the restored repository.

    Conclusion

    Make sure you are deleting the repository that’s not useful for you. And make use of the restoration option in case you deleted a repository by mistake.

    And we can back up a repository in cloud storage. Storing the repository zip in cloud storage like Google Drive, Dropbox, etc.., might help us in the future. If there is a situation where deleting a repository is uncertain, then you can back up the repository in any cloud storage platform and delete it.

    Back up will be useful when you are deleting a complex project. Creating complex or big projects from scratch will take a lot of time. You may back up the complex repositories before deleting them.

    Next, find out how you can set up passwordless authentication to GitHub’s private repo.