How to update public Repository to private in GitHub

Pragti Chauhan
Feature image


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.

Update Repository visibility from public to private

Following are the steps to update the visibility of a public repository to private:

  1. Login to your GitHub account

  2. Navigate to the main page of the repository for which you want to update the visibility

    GitHub repository main page

  3. Click on Settings

    Repository Settings

  4. On the Settings page under General scroll down to Danger Zone section

    Repository Settings Danger Zone

  5. Click on Change visibility and then click on Change to private

    Repository Change visibility

  6. A pop-up will appear for action confirmation. Click on I want to make this repository private

    Make repository private confirmation

  7. 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

    Public repository to private popup

  8. A warning regarding the action appears. Finally click on Make this repository private

    GitHub make repository private

  9. Confirm access by providing the authentication code

    GitHub authentication code

  10. The repository visibility will change to private

    GitHub repository main page

← Back to Academy