Article version: GitHub.com

Setting repository visibility

You can choose who can view your repository.

In this guide

About repository visibility

When creating a repository, you can choose to make it public, internal, or private. Public repositories are accessible to everyone using GitHub.com, while private repositories are accessible to you and the people you share them with. Internal repositories are available with GitHub Enterprise Cloud and are only accessible to members of your enterprise account. For more information, see "Creating an internal repository."

Repository owners, people with admin permissions for an organization-owned repository, and organization owners can change a repository's visibility.

For organization-owned repositories, if an organization owner has restricted the ability to change repository visibility to organization owners only, people with admin permissions to a public repository cannot make it private.

Making a repository private

If you're using GitHub Free, private repositories owned by a personal account may have up to three collaborators. If you have added more than three other users as repository collaborators, you'll need to reduce the number of collaborators to three or fewer before making the repository private, or upgrade to GitHub Pro. For more information, see "Removing a collaborator from a personal repository."

If you're using GitHub Free and change a repository's visibility from public to private, you'll lose access to features like protected branches and GitHub Pages. Any published GitHub Pages site will be automatically unpublished. If you added a custom domain to the GitHub Pages site, you should remove or update your DNS records before making the repository private, to avoid the risk of a domain takeover. For more information, see "Adding or removing a custom domain for your GitHub Pages site."

If you change a repository's visibility from internal to private, forks that belong to any user without access to the newly private repository are removed.

Private repositories have unlimited collaborators and full features on GitHub Pro, GitHub Team, and GitHub Enterprise Cloud. For more information, see "GitHub's products."

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

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

  2. Under your repository name, click Settings.

    Repository settings button

  3. Under "Danger Zone", next to "Make this repository private", click Make private.

    Make private button

  4. Read the warnings about making a repository private.

    Warnings popup

  5. Type the name of the repository that you want to make private, for example accountname/reponame.

  6. Click I understand, make this repository private.

Making a repository public

Warning: When a private repository is made public, its private forks are detached. For more information, see "What happens to forks when a repository is deleted or changes visibility?"

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

  2. Under your repository name, click Settings.

    Repository settings button

  3. Under "Danger Zone", next to "Make this repository public", click Make public.

    Make public button

  4. Read the warnings about making a repository public.

    Pop-up with information about making a private repository public

  5. Type the name of the repository that you want to make public, for example accountname/reponame.

  6. Click I understand, make this repository public.

Resources for creating an open source project

If you're converting your private repository to a public repository as part of a move toward creating an open source project, see the Open Source Guides for helpful tips and guidelines. You can also take a free course on managing an open source project with GitHub Learning Lab. Once your repository is public, you can also view your repository's community profile to see whether your project meets best practices for supporting contributors. For more information, see "Viewing your community profile."

Making a repository internal

Notes

  • Internal repositories are available with GitHub Enterprise Cloud. For more information, see "GitHub's products."
  • Internal repositories are currently in beta and subject to change.
  1. On GitHub, navigate to the main page of the repository.

  2. Under your repository name, click Settings.

    Repository settings button

  3. Under "Danger Zone", next to "Make this repository internal", click Make internal.

    Make internal button

  4. Read the warnings about making a repository internal.

    Warnings popup

  5. Type the name of the repository that you want to make internal, for example accountname/reponame.

  6. Click I understand, make this repository internal.

Ask a human

Can't find what you're looking for?

Contact us