What are GitHub Collaborators?
In GitHub, we can invite other GitHub users to become collaborators to our private repositories(which expires after 7 days if not accepted, restoring any unclaimed licenses). Being a collaborator, of a personal repository you can pull (read) the contents of the repository and push (write) changes to the repository. You can add unlimited collaborators on public and private repositories(with some per day limit restrictions). But, in a private repository, the owner of the repo can only grant write-access to the collaborators, and they can’t have the read-only access.
GitHub also restricts the number of collaborators we can invite within a period of 24 hours. If we exceed the limit, then either we have to wait for 24-hours or we can also create an organization to collaborate with more people.
Actions that can be Performed By Collaborators
Collaborators can perform a number of actions into someone else’s personal repositories, they have gained access to. Some of them are,
- Create, merge, and close pull requests in the repository
- Publish, view, install the packages
- Fork the repositories
- Make the changes on the repositories as suggested by the Pull requests.
- Mark issues or pull requests as duplicate
- Create, edit, and delete any comments on commits, pull requests, and issues in the repository
- Removing themselves as collaborators on the repositories.
- Manage releases in the repositories.
Now, let’s see how can we invite collaborators to our repositories.
Inviting Collaborators to your personal repositories
Follow the steps below to invite collaborators to your own repository(public or private).
Step 1: Get the usernames of the GitHub users you will be adding as collaborators. In case, they are not on GitHub, ask them to sign in to GitHub (refer Sign up).
Step 2: Go to your repository( intended to add collaborators)
Step 3: Click into the Settings.
Step 4: A settings page will appear. Here, into the left-sidebar click into the Manage Access
Step 5: Then a confirm password page may appear, enter your password for the confirmation.
Step 6: Next, click into Invite a collaborator.
Step 7: Then a search field will appear, where you can enter the username of the ones you want to add as collaborator.
Step 8: After selecting the people, add them as collaborator.
Step 9: We are done adding a single collaborator. Now, they will get a mail regarding invitation to your repository. Once they accept, they will have collaborator access to your repository. Till then it will be in pending invitation state. You can also add more collaborator and delete the existing one as depicted below.
Removing collaborator permissions from a person contributing to a repository
Similar to the above steps, go to Your Repository -> Settings -> Manage Access -> Delete icon (on the right side of collaborator username)
Removing yourself from a collaborator’s repository
In case you don’t want to be a collaborator to someone else’s repository then you can remove yourself from being a collaborator. To do this, follow the below steps:
Step 1: Into the top right corners, click into your profile picture and then the settings.
Step 2: Then into the left-side bar click into the Repositories.
Step 3: Click leave to the repository you want to leave.
Step 4: A warning box will appear, read that and then click “I understand, leave this repository.”
And you are done leaving this repository!