Working together on GitHub · lesson 1 of 7
Commands and ideas in this lesson
ACollaboratorsomeone you let push to your repository
BOrganisationan account shared by a group, with roles
CRead, triage, write, maintain, adminan organisation's repository roles

Collaborators and permissions

Last updated

Carla wants to help type up Lola Remy's notebook, and Joaquin wants to fix the pancit. On GitHub, only the owner can push until they let others in. In this lesson you'll see who can do what to a repository, how to invite a collaborator, and when to give less access, or none, and let people use a fork instead.

By the end of this lesson you can

  • Invite a collaborator to a personal repository, and say what they can then do
  • Match people to the right level of access in an organisation: read, triage, write, maintain or admin
  • Remove access, and choose forks for people who shouldn't have any

Who can do what

For a public repository on a personal account, there are three kinds of people:

WhoCan read and cloneCan open issues and pull requestsCan push and mergeCan change settings and delete it
Anyone with a GitHub accountYesYesNoNo
A collaboratorYesYesYesNo
The ownerYesYesYesYes

A private repository is the same, except that "anyone" can't see it at all.

So strangers can still help without any access: they fork the repository (their own copy, lesson 5.5), change that, and open a pull request asking the owner to take the change.

Inviting a collaborator

In Settings › Collaborators, the owner adds people by their GitHub username:

  1. Manage access. Who can see the repository, and who can push. Only the owner sees this page.
  2. Add people. Find someone by username or email and invite them.
  3. A collaborator. Carla accepted, so she can push, make branches and merge pull requests. Remove takes it away straight away.
  4. A pending invite. Joaquin hasn’t accepted yet. Invitations arrive by email and in GitHub’s notifications; access starts only once they accept.
The collaborators settings of a personal repository. The course’s own drawing of this GitHub screen, with GitHub’s names for each part. A screenshot from the course’s demo account will replace it.

On a personal account there's only one level: a collaborator can push to every branch. To stop anyone, collaborators included, pushing straight to main, the owner adds a branch rule that requires a pull request first (lesson 7.4).

Organisations and roles

When a group shares projects, such as a club, a class or a company, they make an organisation: an account owned by a group, like reyes-family. Its repositories can give each person, or each team of people, one of five roles:

RoleWho it's forCan do
ReadPeople who only need to look, or to commentRead and clone, open issues, comment
TriagePeople who sort issues and pull requests, without changing codeRead, plus label, assign and close issues and pull requests
WritePeople who change the projectTriage, plus push, make branches and merge pull requests
MaintainPeople who run the project day to dayWrite, plus some settings, such as the description and topics
AdminThe few people responsible for itEverything, including access, branch rules and deleting the repository

GitLab has the same idea with different names (Guest, Reporter, Developer, Maintainer, Owner); Codeberg too. The rule is the same everywhere: give each person the least access that lets them do their part.

Who gets what?

The family moves Kusina into a reyes-family organisation. Which role for each person?

0 of 6 placed right

  1. Lola Remy, who reads the recipes and sometimes leaves a comment, through Ana

  2. Carla, who types up recipes most weeks and reviews Joaquin’s

  3. Ana, who started it and looks after its settings

  4. Tito Ben, who wants to label the recipe requests and close the duplicates

  5. A stranger who found a typo in the sinigang

  6. Joaquin, who adds a recipe now and then

Spot the trap: admin for everyone

Spot the trapAna

Setting up the reyes-family organisation, Ana gives everyone Admin “so nobody has to ask me for anything”.

What happens if…

Check what you learned

Someone with no access to a public repository wants to suggest a change. What can they do?
A collaborator on Ana’s personal repository can do which of these?
In an organisation, who should have Admin on a repository?

Sources

Every command on this page behaves as these pages describe, and the sandbox prints what Git 2.55 prints. Hosting features (pull requests, protected branches) come from the host’s own documentation.

All sources for Simple Git