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 "Restricting repository visibility changes in your organization."
We recommend reviewing the following caveats before you change the visibility of a repository.
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. GitHub recommends the following before changing the visibility of a repository network.
- Wait for a period of reduced activity on your GitHub Enterprise Server instance.
- Contact your site administrator before proceeding. Your site administrator can contact us for further assistance by visiting GitHub Enterprise Support.
Making a repository private
- GitHub Enterprise Server will detach public forks of the public repository and put them into a new network. Public forks are not made private.
- If you change a repository's visibility from internal to private, 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 "What happens to forks when a repository is deleted or changes visibility?"
- Anonymous Git read access is no longer available. For more information, see "Enabling anonymous Git read access for a repository."
Making a repository internal
- Any forks of the repository will remain in the repository network, and GitHub Enterprise Server maintains the relationship between the root repository and the fork. For more information, see "What happens to forks when a repository is deleted or changes visibility?"
Making a repository public
- GitHub Enterprise Server will detach private forks and turn them into a standalone private repository. For more information, see "What happens to forks when a repository is deleted or changes visibility?"
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 permanently erased, which will affect repository rankings.
- Custom Dependabot alert rules will be disabled unless GitHub Advanced Security is enabled for this repository. Dependency graph and Dependabot alerts will remain enabled with permission to perform read-only analysis on this repository.
- Code scanning will become unavailable.
- 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 your GitHub Enterprise Server instance.
- 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 permanently 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 permanently erased.
Changing from internal to private
- Stars and watchers for this repository will be permanently erased, which will affect repository rankings.
- Custom Dependabot alert rules will be disabled unless GitHub Advanced Security is enabled for this repository. Dependency graph and Dependabot alerts will remain enabled with permission to perform read-only analysis on this repository.
- Code scanning will become unavailable.
- 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 your GitHub Enterprise Server instance.
- 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 permanently 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 permanently erased.
Changing a repository's visibility
-
On GitHub, navigate to the main page of the repository.
-
Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.
-
In the "Danger Zone" section, to the right of to "Change repository visibility", click Change visibility.
-
Select a visibility.
-
To verify that you're changing the correct repository's visibility, type the name of the repository you want to change the visibility of.
-
Click I understand, change repository visibility.