Creating new repositories on GitHub for pet projects can quickly become addicting because of the platform’s widespread use as an online portfolio. If you have stored too many repositories in your GitHub account and would like to clean things up a bit, continue reading to find out how to remove a repository.
Table of Content
Things You Should About Deleting Repository GitHub
- If you are the owner of the organization or if you have admin permissions for the repository or fork in question, you can delete it. However, there are a few details to remember:
- When a fork is deleted, the original repository is unaffected. When a private repository is deleted, any forks that were created from it are also removed, but when a public repository is removed, the forks remain intact.
- When you delete a repository, all of the associated wikis, problems, and comments will also be deleted. Once a repository is erased, it cannot be recovered.
How to Delete a Repository in GitHub
If you have read the notes about deleting the repository on GitHub, you can now follow the steps below:
- Launch GitHub and sign in to your account to start the removal procedure.
- To access your repositories, go to your profile by clicking the profile button in the upper right.
- To remove a repository, simply locate it here and click on its name. Then, select the Settings tab from the toolbar.
- To reach the Danger Zone, please scroll down to the very bottom of the page. Select the option to delete the current repository.
- A confirmation window will now appear, asking if you are sure you want to remove the repository. You can delete the repository by typing its name in the text field and then clicking the I understand the consequences, delete this repository button.
Note: You can always archive the repository instead of erasing everything if you’re hesitant about erasing everything. Use the option to Archive this repository from the same Danger Zone section. Although other users will be unable to make changes, the repository can still be forked. Simply returning to the repository’s settings page and selecting Unarchive this repository will bring it back to life. - After deleting the repository, you’ll be returned to the GitHub home page, with a banner at the top informing you that the repository was successfully deleted.
How to Restore A Deleted Repository in GitHub
If a deleted repository was not part of an empty fork network, it can be recovered within 90 days. A fork network includes the original repository, all of its forks, and all of the forks. To get your repository back online if it was part of a fork network, all the other repositories in the network must be destroyed or detached from the network. Click “About forks” for additional details.
Contact GitHub Support if you want to restore a repository that was once part of a fork network but is not currently empty. After a repository is deleted, it may take up to an hour before it can be restored. Both release attachments and team permissions will be lost if a repository is restored. Resolved problems won’t be marked as such.
There are two ways to restore a deleted repository in GitHub, which are from a personal account and an organization account. Follow through the steps below!
Restoring a deleted repository on Personal Account
- Click your profile picture at the top right of any page, then select Settings from the drop-down menu that appears.
- Select Repositories from the sidebar’s “Code planning, and automation” option.
- To view the deleted repositories, select that option from the “Deleted Repositories” menu.
- In the list of repositories, select the one you wish to restore and then click the Restore button.
- When you’re done reading the cautionary message, select the “I understand, restore this repository” option.
Restoring a deleted repository on Organization Account
- To view your organization’s repositories on GitHub.com, click your profile picture in the upper right corner and select Your Organization.
- Select Preferences beside the company.
- The link to Deleted Repositories can be found in the sidebar to the left.
- In the list of repositories, select the one you wish to restore and then click the “Restore” button.
- When you’re done reading the cautionary message, select the “I understand, restore this repository” option.
Tips
If you need to customize your repository on GitHub, you can do many things. These are the things you can do in customizing your repository.
- Changing your default text editor associated with GitHub.
- Changing your dotfiles.
- Installing Hub for your repo.
- Practicing the merge conflicts.
- Creating a GitHub Page.