What happens to forks when a repository is deleted or changes visibility?

Deleting your repository or changing its visibility affects that repository's forks.

Warning:

  • If you remove a person’s access to a private repository, any of their forks of that private repository are deleted. Local clones of the private repository are retained. If a team's access to a private repository is revoked or a team with access to a private repository is deleted, and team members do not have access to the repository through another team, private forks of the repository will be deleted.

  • You are responsible for ensuring that people who have lost access to a repository delete any confidential information or intellectual property.

  • People with admin permissions to a private or internal repository can disallow forking of that repository, and organization owners can disallow forking of any private or internal repository in an organization. For more information, see "Managing the forking policy for your organization" and "Managing the forking policy for your repository."

Deleting a private repository

When you delete a private repository, all of its private forks are also deleted.

Private forks and permissions

Private forks inherit the permissions structure of the upstream or parent repository. For example, if the upstream repository is private and gives read/write access to a team, then the same team will have read/write access to any forks of the private upstream repository. This helps owners of private repositories maintain control over their code.

Changing the visibility of an internal repository

Note: Internal repositories are available with GitHub Enterprise Cloud, GitHub AE, and GitHub Enterprise Server 2.20+. For more information, see "GitHub's products."

If the policy for your enterprise permits forking, any fork of an internal repository will be private. If you change the visibility of an internal repository, any fork owned by an organization or user account will remain private.

Deleting the internal repository

If you change the visibility of an internal repository and then delete the repository, the forks will continue to exist in a separate network.

Further reading

Did this doc help you?Privacy policy

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Or, learn how to contribute.