Repo access
1. Repo access
So far, we've worked with a public repo, meaning anyone can access it. But what if we need to restrict who can see and use our repo?2. Why restrict access?
We mentioned that one of GitHub's key benefits is that anyone with an internet connection can access the platform. While this is true, there are some scenarios where we need our repo to be private. For example, we might be using datasets with personally identifiable information such as an address. Or we could be developing or using a commercial system that we will sell to customers, such as an AI model to predict stock requirements in a warehouse. We don't want people to be able to see our code as they can use it to make their own system.3. Bank marketing campaign
We have been asked to work on a project analyzing data from a bank about their marketing campaign, which aimed to get customers to place a deposit into their accounts. Here are the column names and a brief description. The deposit column has yes or no values to reflect whether the campaign was successful or not for each individual. As it contains individual names and addresses, we cannot place this in a public repo.4. Creating a private repo
We can create a private repo by clicking the New repository button. In this page we can name it bank marketing. This time, we change access from Public to Private, as shown here.5. Is it private?
How do we know the repo is private? Firstly, the word Private appears next to our repo name.6. Is it private?
Secondly, if we are not signed in and we try to visit the repo's URL, the page can't be located.7. Collaboration in a private repo
Having a private repo is all well and good, but we still want to collaborate with colleagues so they need to be able to view and interact with the project. We can choose who can access our repo by visiting the Settings tab, and selecting the Collaborators option in the Access section.8. Collaborators
This page has two sections. The first shows who has access. Currently it is a private repo and no collaborators can access it.9. Collaborators
The second section is to manage access, where we can add people by clicking the green button.10. Adding a collaborator
This opens a pop up window where we can search by username, full name, or email. Note that this will search all of GitHub, so we should make sure we have these exact details before this step, or it will be difficult to find who we are looking for.11. Adding a collaborator
We add our colleague Jasmin, who is going to work on the project with us. We then select Add jasminludolf to this repo. When the pop up window closes, we see that one person now has direct access, and Jasmin's profile is in the Manage access section with a Pending Invite. Once Jasmin accepts our invite, she will be able to access the repo.12. Let's practice!
Now it's your turn to set up a private repo and add collaborators!Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.