Skip to main content

How to make a repository Private/Public

There are 2 methods to make a repository public/private.

  • While creating a new repository.
  • Modifying a pre-existing repository.

Let us look at the Method - 1

Creating a new repository.

Step 1 :

Login to your Github account and click on the '+' icon at the top right corner to create a new repository

Step 2 :

Provide any suitable name to the repository

Step 3 :

Just below you will find 2 options -> Public and Private and choose the approoriate option

Screenshot-2022-10-07-at-16-23-55.png

Step 4 :

Scroll down and click on "Create Repository"

Screenshot-2022-10-07-at-16-52-02.png

Hurray, you just created a new repository 🎉

(Based on the option you chose, your repository will be either Private or Public. )

If you want to change the repository visibility setting again, follow the steps below


Let us look at the Method - 2

Modifying a pre-existing repository.

Step 1 :

Open the repository that you want to modify and click on the "Settings" option

Screenshot-2022-10-07-at-17-02-05.png

Step 2 :

Scroll down to the botton until you find the "Danger Zone" menu and click on the "Change repository visibility" option.

Screenshot-2022-10-07-at-17-08-04.png

Step 3 :

Choose the option to modify the repository from Public to Private or vice versa, and enter your "GitHub username/repository name" to confirm and click on the I understand, change repository visibility option

Screenshot-2022-10-07-at-17-26-23.png

Step 4 :

Enter your Github password to confirm the changes.


Hurray, you just modified the visibility of your repository 🎉 🚀