You can change a repository's visibility from public to private if you're an organization owner or have admin permissions for the repository.

If an organization owner has restricted the ability to change repository visibility to organization owners only, members with admin permissions to a public repository cannot make it private. For more information, see "Repository permission levels for an organization."

Warning: When a public repository is made private, public forks of the public repository are detached and put into a new network. They are not made private. For more information, see "What happens to forks when a repository is deleted or changes visibility?"

  1. On GitHub Enterprise, navigate to the main page of the repository.

  2. Repository settings buttonUnder your repository name, click Settings.

  3. Make Private buttonClick Make private.

  4. Warnings popupRead the warnings.
  5. Type the name of the repository that you want to make private.
  6. Warning PopupClick I understand, make this repository private.