Search code examples
gitgithubworkflowcollaboration

Pros and Cons of different ways of collaboration flow on Github Repo


What are the pros and cons of each of the following ways of collaboration flow on github?

  1. Team members Forked the main repo and work on their forked repo, then push the code from forked repo to main repo.
  2. Team members work on the main repo directly.

Solution

  • The first method is easier to maintain a unique reference, controller by a maintainer in charge of accepting PRs (pull requests)

    You don't have to protect branches, since the collaborators are working in their own forks.

    But: it is more complex to set up for collaborators: in addition to their fork, they neeed to add the original repository as an "upstream" repository, in order to fetch and rebase their PR branches on top of an up-to-date upstream master branch, if they want their PRs to apply cleanly.


    The second method is easier for collaborator, but involve a strict branch protection, in order to control who can push to where.