8.2 KiB
title, intro, redirect_from, versions
| title | intro | redirect_from | versions | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Setting repository visibility | You can choose who can view your repository. |
|
|
About repository visibility changes
Organization owners can restrict 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.
Making a repository private
{% if currentVersion == "free-pro-team@latest" or enterpriseServerVersions contains currentVersion %}
- {% data variables.product.product_name %} will detach public forks of the public repository and put them into a new network. Public forks are not made private.{% endif %}
- If you change a repository's visibility from internal to private, {% data variables.product.prodname_dotcom %} will remove forks that belong to any user without access to the newly private repository. {% if currentVersion == "free-pro-team@latest" or enterpriseServerVersions contains currentVersion %}The visibility of any forks will also change to private.{% elsif currentVersion == "github-ae@latest" %}If the internal repository has any forks, the visibility of the forks is already private.{% endif %} For more information, see "What happens to forks when a repository is deleted or changes visibility?"{% if currentVersion == "free-pro-team@latest" %}
- If you're using {% data variables.product.prodname_free_user %} for user accounts or organizations, some features won't be available in the repository after you change the visibility to private. {% data reusables.gated-features.more-info %}{% endif %}
- Any published {% data variables.product.prodname_pages %} site will be automatically unpublished.{% if currentVersion == "free-pro-team@latest" %} 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 "Managing a custom domain for your {% data variables.product.prodname_pages %} site."{% endif %}{% if currentVersion == "free-pro-team@latest" %}
- {% data variables.product.prodname_dotcom %} will no longer included the repository in the {% data variables.product.prodname_archive %}. For more information, see "About archiving content and data on {% data variables.product.prodname_dotcom %}."{% endif %}{% if enterpriseServerVersions contains currentVersion %}
- Anonymous Git read access is no longer available. For more information, see "[Enabling anonymous Git read access for a repository](/enterprise/{{ currentVersion }}/user/articles/enabling-anonymous-git-read-access-for-a-repository)."{% endif %}
{% if currentVersion == "free-pro-team@latest" or currentVersion == "github-ae@latest" or currentVersion ver_gt "enterprise-server@2.19" %}
Making a repository internal
{% note %}
Note: {% data reusables.gated-features.internal-repos %}
{% endnote %}
- Any forks of the repository will remain in the repository network, and {% data variables.product.product_name %} 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?"
{% endif %}
{% if currentVersion == "free-pro-team@latest" or enterpriseServerVersions contains currentVersion %}
Making a repository public
- {% data variables.product.product_name %} 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?"{% if currentVersion == "free-pro-team@latest" %}
- 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 "Viewing your community profile."{% endif %}
{% endif %}
{% if currentVersion == "free-pro-team@latest" or currentVersion == "github-ae@latest" or currentVersion ver_gt "enterprise-server@2.21" %}
Changing a repository's visibility
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.sidebar-settings %}
3. Under "Danger Zone", to the right of to "Change repository visibility", click Change visibility.
4. Select a visibility.
5. To verify that you're changing the correct repository's visibility, type the name of the repository you want to change the visibility of.
6. Click I understand, change repository visibility.

{% endif %}
{% if currentVersion ver_lt "enterprise-server@2.22" %}
Making a repository private
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.sidebar-settings %}
3. Under "Danger Zone", next to "Make this repository private", click Make private.
4. Read the warnings about making a repository private.
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
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.sidebar-settings %}
3. Under "Danger Zone", next to "Make this repository public", click Make public.
4. Read the warnings about making a 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.
{% if currentVersion ver_gt "enterprise-server@2.19" %}
Making a repository internal
{% data reusables.organizations.internal-repos-enterprise %}
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.sidebar-settings %}
3. Under "Danger Zone", next to "Make this repository internal", click Make internal.
4. Read the warnings about making a repository internal.
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.
{% endif %}
{% endif %}