Skip to content

Latest commit

 

History

History
136 lines (100 loc) · 10.1 KB

File metadata and controls

136 lines (100 loc) · 10.1 KB
title Setting repository visibility
intro You can choose who can view your repository.
redirect_from
/articles/making-a-private-repository-public
/articles/making-a-public-repository-private
/articles/converting-a-public-repo-to-a-private-repo
/articles/setting-repository-visibility
/github/administering-a-repository/setting-repository-visibility
/github/administering-a-repository/managing-repository-settings/setting-repository-visibility
versions
fpt ghes
*
*
topics
Repositories
shortTitle Repository visibility

About repository visibility changes

Note

If you can't change a repository's visibility, the organization owner may have restricted the ability to change repository visibility to organization owners only. For more information, see AUTOTITLE.

{% ifversion ghec %}

Members of an {% data variables.enterprise.prodname_emu_enterprise %} can only set the visibility of repositories owned by their personal account to private, and repositories in their enterprise's organizations can only be private or internal. For more information, see AUTOTITLE.

{% endif %}

We recommend reviewing the following caveats before you change the visibility of a repository.

{% ifversion ghes %}

Warning

Changes to the visibility of a large repository or repository network may affect data integrity. Visibility changes can also have unintended effects on forks. {% data variables.product.company_short %} recommends the following before changing the visibility of a repository network.

  • Wait for a period of reduced activity on {% data variables.location.product_location %}.
  • Contact your site administrator before proceeding. Your site administrator can contact us for further assistance by visiting {% data variables.contact.contact_ent_support %}.

{% endif %}

Making a repository private

  • {% data variables.product.github %} will detach public forks of the public repository and put them into a new network. Public forks are not made private. {%- ifversion ghes or ghec %}
  • If you change a repository's visibility from internal to private, {% data variables.product.github %} will remove forks that belong to any user without access to the newly private repository. The visibility of any forks will also change to private. For more information, see AUTOTITLE {%- endif %} {%- ifversion fpt %}
  • If you're using {% data variables.product.prodname_free_user %} for personal accounts or organizations, some features won't be available in the repository after you change the visibility to private. Any published {% data variables.product.prodname_pages %} site will be automatically unpublished. If you added a custom domain to the {% data variables.product.prodname_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 AUTOTITLE and AUTOTITLE. {%- endif %} {%- ifversion fpt or ghec %}
  • {% data variables.product.prodname_dotcom %} will no longer include the repository in the {% data variables.product.prodname_archive %}. For more information, see AUTOTITLE.
  • {% data variables.product.prodname_GHAS %} features, such as {% data variables.product.prodname_code_scanning %}, will stop working unless the repository is owned by an organization that has access to the feature in private repositories with a {% data variables.product.prodname_GHAS %}{% ifversion ghas-products %}, {% data variables.product.prodname_GH_code_security %}, or {% data variables.product.prodname_GH_secret_protection %}{% endif %} license and sufficient spare seats. {% data reusables.advanced-security.more-info-ghas %} {%- endif %} {%- ifversion ghes %}
  • Anonymous Git read access is no longer available. For more information, see AUTOTITLE. {%- endif %}

{% ifversion ghes or ghec %}

Making a repository internal

  • Any forks of the repository will remain in the repository network, and {% data variables.product.github %} maintains the relationship between the root repository and the fork. For more information, see AUTOTITLE

{% endif %}

Making a repository public

  • {% data variables.product.github %} will detach private forks and turn them into a standalone private repository. For more information, see AUTOTITLE{% ifversion fpt or ghec %}
  • 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 [{% data variables.product.prodname_learning %}]({% data variables.product.prodname_learning_link %}). 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 AUTOTITLE.
  • The repository will automatically gain access to {% data variables.product.prodname_GHAS %} features.
  • Actions history and logs will be visible to everyone. If your repository had reusable or required workflows that were shared from a different repository in your organization, the workflow file path including the repository name will be visible in the logs. For more information on how to remove workflow runs and artifacts see AUTOTITLE and AUTOTITLE.

For information about improving repository security, see AUTOTITLE.{% endif %}

Consequences of changing a repository's visibility

[!CAUTION]Before you change your repository's visibility, understand the consequences of this change.

Changing from public to private

  • Stars and watchers for this repository will be erased, which will affect repository rankings.
  • Custom {% data variables.product.prodname_dependabot %} alert rules will be disabled unless {% data variables.product.prodname_GH_code_security %} is enabled for this repository. Dependency graph and {% data variables.product.prodname_dependabot_alerts %} will remain enabled with permission to perform read-only analysis on this repository.
  • {% data variables.product.prodname_code_scanning_caps %} will become unavailable unless {% data variables.product.prodname_code_security %} is enabled for this repository.
  • Current forks will remain public and will be detached from this repository.

Changing from private to public

  • The code will be visible to everyone who can visit {% data variables.location.product_location %}.
  • Anyone can fork your repository.
  • All push rulesets will be disabled.
  • Your changes will be published as activity.
  • Actions history and logs will be visible to everyone.
  • Stars and watchers for this repository will be erased.

Changing from private to internal

  • All members of the enterprise will be given read access.
  • Outside collaborators can no longer be added to forks unless they're added to the root.
  • Stars and watchers for this repository will be erased.

Changing from internal to private

  • Stars and watchers for this repository will be erased, which will affect repository rankings.
  • Custom {% data variables.product.prodname_dependabot %} alert rules will be disabled unless {% data variables.product.prodname_GH_code_security %} is enabled for this repository. Dependency graph and {% data variables.product.prodname_dependabot_alerts %} will remain enabled with permission to perform read-only analysis on this repository.
  • {% data variables.product.prodname_code_scanning_caps %} will become unavailable unless {% data variables.product.prodname_code_security %} is enabled for this repository.
  • Current forks will remain public and will be detached from this repository.

Changing from internal to public

  • The code will be visible to everyone who can visit {% data variables.location.product_location %}.
  • Anyone can fork your repository.
  • All push rulesets will be disabled.
  • Your changes will be published as activity.
  • Actions history and logs will be visible to everyone.
  • Stars and watchers for this repository will be erased.

Changing from public to internal

  • All members of the enterprise will be given read access.
  • Outside collaborators can no longer be added to forks unless they're added to the root.
  • Stars and watchers for this repository will be erased.

Changing a repository's visibility

{% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %}

  1. In the "Danger Zone" section, to the right of to "Change repository visibility", click Change visibility.
  2. Select a visibility.
  3. Click to confirm that you are changing the visibility of the correct repository.
  4. Click I have read and understand these effects.
  5. Click Make this repository public or Make this repository private.

Further reading