What visibility options GitHub gives you

GitHub lets you control who can see your repository through three visibility settings: public, private, and internal. Public repositories are visible to anyone on the internet. Private repositories are visible only to you and people you explicitly invite. Internal repositories are visible only to members of your organization (this option is only available if your repository is hosted on GitHub Enterprise or within an organization account).

You can change a repository's visibility at any time. The process takes less than a minute and doesn't delete your code or history — it only changes who can see it. The change takes effect immediately.

Key Takeaways

  • Repository visibility is changed in the Settings tab of your repository, under the Danger Zone section.
  • Changing a public repository to private means people who forked it will keep their own copies, but new people cannot fork it.
  • You must have admin access to the repository to change its visibility.
  • GitHub will ask you to type the repository name to confirm the change, especially when making a repository private.
  • Collaborators keep their existing access level when you change visibility — the change only affects who outside your permission list can see the repository.

Steps to change visibility from public to private

Go to your repository on GitHub and click the Settings tab near the top right. Scroll down to the section labeled Danger Zone — this is where destructive or significant changes live. Look for the option that says Change repository visibility or Make this repository private.

Click the button. GitHub will show you a warning that explains what happens: existing forks will remain public, but new people cannot fork your repository. Read this carefully. Then type your repository name exactly as shown to confirm you understand what you're doing. Click the confirmation button. Your repository is now private.

Steps to change visibility from private to public

Open your repository and go to Settings. Scroll to the Danger Zone section and find Change repository visibility. Click it and select the option to make the repository public.

GitHub will warn you that anyone on the internet will be able to see your code. This includes search engines, which may index it. Type your repository name to confirm. Once you click the button, your repository is public immediately. Anyone can view your code, but they cannot push changes unless you add them as a collaborator.

What happens to forks and collaborators

If you change a public repository to private, people who already forked it keep their own public copies. You cannot force their forks to become private. However, new people cannot create forks of your repository once it is private. This is permanent — even if you change the repository back to public later, those old forks remain separate repositories owned by other people.

Collaborators you added before the change keep their access level. If someone had read access, they still have read access to the private repository. If they had write access, they still have write access. Changing visibility does not remove anyone's permissions — it only changes who outside your permission list can see the repository. People who could not see the repository before the change still cannot see it afterward.

Who can change repository visibility

Only people with admin access to the repository can change its visibility. If you own the repository, you have admin access. If someone else owns it and added you as a collaborator, you probably do not have admin access unless they gave it to you explicitly.

If you do not see the Settings tab or the Danger Zone section, you do not have admin access. Ask the repository owner to change the visibility, or ask them to give you admin permissions first. Admin access is different from write access — write access lets you push code, but only admin access lets you change settings like visibility.

Visibility changes for organization repositories

If your repository belongs to an organization, the visibility options may include internal in addition to public and private. Internal means only members of your organization can see it. The process for changing visibility is the same — go to Settings, find Danger Zone, and select the new visibility level.

Organization owners and repository admins can change visibility. Some organizations have policies about which visibility levels are allowed, so you may not be able to make a repository public even if you have admin access. Check with your organization's settings or ask an owner if you cannot find the visibility option you want. These policies exist to protect sensitive code or maintain compliance standards.

Frequently Asked Questions

Can I change visibility without losing my code or commit history?

Yes. Changing visibility does not touch your code, branches, or history. Everything stays exactly as it was. Only the permission to view the repository changes.

What if I change a repository to private and then change it back to public?

Your repository becomes public again and anyone can see it. People who forked it while it was public still have their forks. The change is reversible.

Do I need to tell collaborators when I change visibility?

Not technically — they keep their access. But it is good practice to let them know, especially if you are making a repository private. They may be surprised to find they cannot share the link with others anymore.

What happens to issues and pull requests when visibility changes?

They stay with the repository. If you make a repository private, people who are not collaborators cannot see the issues or pull requests anymore. If you make it public, they become visible to everyone.

Can I schedule a visibility change for later?

No. Visibility changes happen immediately when you confirm them. There is no way to schedule a change for a future date through GitHub's interface.