Lesson Monday

Working in a team rather than alone can allow you to build more advanced projects, but it can be a little tricky to divide up the work and make sure that no one is overwriting anyone else's code unintentionally. We have used Git to backup our work and save our changes as we go, but it is also a powerful tool for working in a group.

To determine the best workflow for team development, a few decisions have to be made regarding the roles of team members. On GitHub, developers contributing to the project can be owners, collaborators or contributors. In this lesson, we detail how a team member's role will determine the workflow for team development.

Remote Repository Ownership

One of the first decisions a team will need to make is to determine who will own the GitHub remote repository. Every project should have one master repository that is created with a single GitHub account. If there is a logical owner or team leader for the project, it makes sense that the master repository is created with their account. If not, the team should determine who will create the master and therefore be the owner.

The owner will have the following privileges for the repository:

  • add and remove collaborators
  • change the visibility of the repository (public vs private)
  • delete the repository
  • implement all collaborator privileges

Once an owner is determined, other developers can work on the code as either collaborators or contributors.

Collaborators

Collaborators are members of the core development team and are officially designated as collaborators by the owner. When working in teams at Epicodus, team members are collaborators.

Collaborators have the following privileges for the repository:

  • push to (write) and pull from (read) the master repository
  • manage issues
  • merge and close pull requests (code from contributors)
  • remove themselves as collaborators

They will use a [branching and merging] workflow when they add and modify code for the project.

To assign a person as a collaborator, the owner will need to follow these steps:

  1. Go to the Settings menu on the right side of the master repository (see in red box below). GitHub repo settings

  2. Go to Collaborators and Teams on the left side menu:

GitHub collaborator assignment

  1. Add a team member by GitHub username, full name or email in the Collaborators form.

  2. Press Add collaborator. The team member has now been added as an official collaborator and is able to make commits directly to the master repository.

Contributors

Anyone can be a contributor on an open source repository. Contributors are interested developers that want to offer code but can NOT make commits directly to the master repository. The workflow of a contributor uses [forking and pulling] to submit their code for review (pull request) to the core development team. The core team can then determine whether to merge the code with the master or not.

Terminology


These terms are used in regards to GitHub repositories.

  • Owner: The person who creates a repository on their GitHub account and has all of the privileges available to any user plus the ability to:

    • add and remove collaborators
    • change the visibility of the repository (public vs private)
    • delete the repository
    • implement all collaborator privileges
  • Collaborator: A core member of the development team working on a project; granted the collaborator role by the owner. Includes the following privileges:

    • push to (write) and pull from (read) the master repository
    • manage issues
    • merge and close pull requests (code from contributors)
    • remove themselves as collaborators
  • Contributor: Any developer that contributes code to a repository by forking it and submitting pull requests for review by the core team.