Git Workflows

Git Workflows

So far you have been working with two related repositories, pretending that each was ‘owned’ by a separate person on a team. Of course, there might be any number of individuals on a team, each with their own repository clone. Unfortunately, it can become difficult to coordinate changes if everyone is regularly committing to their repositories.

Distributed Workflow
Figure: Distributed Repositories
In a truly distributed workflow, each team member is responsible for pulling changes from every other team member as needed.

To simplify the workflow, one approach is to dedicate someone as a repository maintainer who is responsible for pulling all changes from everyone else's repositories. Everyone else then regularly pulls from this individual to keep their repositories up to date.

Distributed Workflow with Repository Maintainer
Figure: Distributed Repositories with Dedicated Maintainer
A simpler approach is for one team member to maintain a central repository from which everyone else pulls.

The most common workflow is to host a central repository on a server accessible to everyone on the team. This arrangement requires a particular configuration of the central repository which allows it to be pushed to instead of just pulled from. We will discuss how this works in the next lessons.

Centralized Workflow
Figure: Central Repository
The most common workflow is to have a central repository that everyone can pull from and push to.