GitHub How To Delete Repository?

560 Views
0 rating based on 0 reviews

I used to use GitHub. But it was hard because I couldn't easily delete my repository while installing a new application. That's because I accidentally created a repository on GitHub, and there was no way to delete it. That's when I realized that GitHub has a useful "delete repository" option.

Delete GitHub Repository

GitHub is an IT service management company that is commonly used for open source projects and people can collaborate there together to make changes if needed. A team can create, edit, and remove files to which they have been granted access.

It is an open-source platform for people to share their ideas and thoughts. To delete a repository, you must be the owner or have admin permissions to make changes to the repository. Deleting a repository cannot be reversed. So, you must be sure to check before deleting it.

Deleting particular files in a repository

Performing this action will delete a particular file in the repository. You can delete any files in the repository you want without deleting the entire repository. This saves you from the possibility of removing the entire file if you are not sure of yourself whether there are files you need for future purposes or accidentally delete other people’s work that you had no authority of removing. To ensure it, please follow these steps.

  1. First, open your GitHub account by signing in.
    GitHub homepage
  2. On the left section of the home page, you will see the list of repositories you have saved. Click the particular repository which contains the files you prefer to delete.
    Repository list
  3. Click the file you want to delete.
    Files in the repository
  4. On the preview page of the file, go to the right section. You will see a delete icon. Click it.
    preview page of the file
  5. You will be asked for permission for committing changes. Click “Commit Changes” for confirmation.
    Applying Changes

You have now successfully removed the file from your repository.

Deleting the entire repository

This action will delete the entire repository along with the files in it. All changes made in the file will be lost and cannot be recovered. So, you have to make sure you have checked the repository before you attempt to perform this action. Please go through the following procedures. 

  1. Go to your GitHub account by signing in.
    GitHub Home page
  2. Go to the menu of your account and select > Your file repositories.
  3. There, you will have all your repositories list. Select the repository you want to delete.
    List of Repositories
  4. Click the “Settings” option on the right.
    Repository options
  5. Scroll down towards the bottom of the page. There, you will see the “Delete this repository” option in the “Danger Zone”. Be very careful before performing these actions as these actions have certain consequences. Click “Delete this repository”.
    Danger Zone options
  6. You will get a pop-up warning to confirm the deleting of the repository.
    Pop-up warning
  7. You can always return if you have selected the wrong repository. Confirm delete by typing the words provided and click “I understand the consequences, delete this repository”.

Now you have successfully deleted the repository from your account. Remember, you or the people from your team who made the changes in the repository will be lost and cannot be recovered.

Summary: GitHub how to delete repository?

  • Deleting a repository you created on GitHub
  • If you want to delete a repository you created on GitHub, you'll need to use the Terminal (for Mac and Linux users) or the Command Prompt (for Windows users).
  • When you delete a repository, it will be completely gone from your account and can't be recovered. You'll need to clone the repository again if you wish to use it once more.
  • Deleting a repository from the command line
  • Use these steps to delete a repository through the command line. Note that everything in the repository, including issues, wiki pages and comments, will be deleted.
  • Make sure there are no open issues in your repository. You cannot delete an issue that is still open. Only close outstanding issues before deleting your repository.
  • From your project repository, check out a new branch and test the new code.
  • Delete the branch, then go to the main page of your fork on GitHub. Click "Pull requests." Then click "New Pull Request."
  • Click "Edit" next to Branch. Change both drop-down menus to master branches and click "Update pull request."
  • Takeaway: Use these