Change repository from public to private in GitHub

GitHub allows unlimited free private repositories and to take advantage of it, you can change the repository status from public to private by following the steps listed below. (As a free user, you can change any repos you control to private)

Change repository visibility to private in GitHub

  1. Go to GitHub.com and the repository where you want to change the visibility

    GitHub Repo Visibility

  2. Scroll down to “Danger Zone”

  3. Click on “Change Visibility” in the Danger Zone

    GitHub Repo Visibility

  4. Then Click on “Change to Private” and again click on “I want to make this repository private”

    GitHub Repo Visibility

  5. Making a repository private will erase all stars and watches, it will also affect the rankings. If you are still okay with it, then go ahead and click on “I have read and understand these effects

  6. Repositories visibility will change to private


By following the above process, we will be able to change the repository from public to private in Github.


Reasons to Make Your Repository Private

There are several reasons why you might choose to make your GitHub repository private:



Maintaining Control: Even if your code isn’t classified as secret, you might simply prefer to have more control over who can view and interact with it.

Protecting Sensitive Code: If your code contains confidential information or trade secrets, keeping it private is essential.

Limited Collaboration: You might only want to collaborate with a specific group of people on a project. Making your repository private ensures that only those you invite can access the code.

Early Stage Development: Sometimes, you might not want your project to be publicly visible during the initial development phase. A private repository allows you to work on it in private until you’re ready to share it with the world.

You may also like...