GitHub is the world's leading development platform for open source and private projects, and is used by millions of developers worldwide. While most of the content on GitHub is public, there are times when developers may want to make a repo private to ensure that only those with the necessary access can view the contents of the repo. This guide will take you through the steps required to make a public repo private on GitHub.
What Is a Private Repo?
A private repo is a GitHub repository that only those who have been given access can view or edit. This means that the contents of the repo are not visible to the public, and only those who have been given the necessary permissions can view or edit the contents of the repo. Private repos can be useful for projects that are sensitive in nature, or that require access control.
Creating a Private Repo
Creating a private repo is relatively straightforward. First, log in to GitHub and navigate to the repository you would like to make private. At the top of the page, you will see a button labeled ‘Settings’. Click on this button and a new page will open.
On the left-hand side of the page, you will see the option ‘Repository visibility/privacy’. Click on this option and a new window will open. Here, you will have the option to make your repo private. Once you have selected this option, click on the ‘Save changes’ button to confirm the changes.
Adding Members to a Private Repo
Once you have made a repo private, you will need to add members who can view or edit the contents of the repo. To do this, navigate to the ‘Settings’ tab on the repository page and click on the ‘Manage access’ option. A new window will open where you can add members to the repo.
In the ‘Add members’ field, type in the username of the person you would like to add to the repo. You can also specify the role they should have, such as ‘owner’, ‘admin’, ‘write’, or ‘read’. Once you have added the member, click on the ‘Add’ button to confirm the changes.
Inviting Collaborators to a Private Repo
If you would like to invite collaborators to a private repo, you can do so by navigating to the ‘Settings’ tab on the repository page. Here, you will see the ‘Manage access’ option. Click on this option and a new window will open.
In the ‘Invite collaborators’ field, type in the username of the person you would like to invite to the repo. You can also specify the role they should have, such as ‘owner’, ‘admin’, ‘write’, or ‘read’. Once you have added the collaborator, click on the ‘Invite’ button to confirm the changes.
Deleting Members and Collaborators From a Private Repo
If you would like to delete a member or collaborator from a private repo, you can do so by navigating to the ‘Settings’ tab on the repository page. Here, you will see the ‘Manage access’ option. Click on this option and a new window will open.
In the ‘Delete members’ or ‘Delete collaborators’ fields, type in the username of the person you would like to delete. Once you have deleted the member or collaborator, click on the ‘Delete’ button to confirm the changes.
Frequently Asked Questions
What is a Private Repo?
A private repo is a GitHub repository that only those who have been given access can view or edit. This means that the contents of the repo are not visible to the public, and only those who have been given the necessary permissions can view or edit the contents of the repo.
How do I make a repo private?
To make a repo private, log in to GitHub and navigate to the repository you would like to make private. At the top of the page, you will see a button labeled ‘Settings’. Click on this button and a new page will open. On the left-hand side of the page, you will see the option ‘Repository visibility/privacy’. Click on this option and a new window will open. Here, you will have the option to make your repo private. Once you have selected this option, click on the ‘Save changes’ button to confirm the changes.
How do I add members to a Private Repo?
To add members to a Private Repo, navigate to the ‘Settings’ tab on the repository page and click on the ‘Manage access’ option. A new window will open where you can add members to the repo. In the ‘Add members’ field, type in the username of the person you would like to add to the repo. You can also specify the role they should have, such as ‘owner’, ‘admin’, ‘write’, or ‘read’. Once you have added the member, click on the ‘Add’ button to confirm the changes.
How do I invite collaborators to a Private Repo?
To invite collaborators to a Private Repo, navigate to the ‘Settings’ tab on the repository page and click on the ‘Manage access’ option. A new window will open where you can add members to the repo. In the ‘Invite collaborators’ field, type in the username of the person you would like to invite to the repo. You can also specify the role they should have, such as ‘owner’, ‘admin’, ‘write’, or ‘read’. Once you have added the collaborator, click on the ‘Invite’ button to confirm the changes.
How do I delete members and collaborators from a Private Repo?
To delete members and collaborators from a Private Repo, navigate to the ‘Settings’ tab on the repository page. Here, you will see the ‘Manage access’ option. Click on this option and a new window will open. In the ‘Delete members’ or ‘Delete collaborators’ fields, type in the username of the person you would like to delete. Once you have deleted the member or collaborator, click on the ‘Delete’ button to confirm the changes.
What are the benefits of a Private Repo?
Private repos can be useful for projects that are sensitive in nature, or that require access control. They can also be used to collaborate on private projects between members of a team without exposing the project to the public. Additionally, private repos can be used to store sensitive data that should not be accessible to the public.
Do I need to pay for a Private Repo?
No, GitHub offers private repos for free. However, if you need more storage space or want to add more members to your repo, you may need to upgrade to a paid plan.