GitHub repository visibility can either be public or private. A public repository allows anyone to access the code and other information in the repository. These are searchable on GitHub and can be crawled by search engines.
Publicly exposing a repository when it is not supposed to be exposed allows any Internet user to access the code and can result in theft of intellectual property. A repository should not be made public unless it has to be shared with the world.
In this article, we will see how to update visibility of a public repository to private.
Following are the steps to update the visibility of a public repository to private:
Login to your GitHub account
Navigate to the main page of the repository for which you want to update the visibility
Click on Settings
On the Settings page under General scroll down to Danger Zone section
Click on Change visibility and then click on Change to private
A pop-up will appear for action confirmation. Click on I want to make this repository private
The pop-up will provide more information on effects of changing a public repository to private. Click on I have read and understand these effects
A warning regarding the action appears. Finally click on Make this repository private
Confirm access by providing the authentication code
The repository visibility will change to private