brentonstrine
brentonstrine

Reputation: 22732

GitHub workflow: Should each developer have their own fork?

Our team is using GitHub for the first time. We set it up so that we can use pull requests as a way to do code reviews.

  1. There is a group organization that everyone has rights to, and which contains the canonical repo.
  2. Each developer forked the group repo and pushes changes to their fork.
  3. Developers submit a pull request to the group repo when ready, and another developer reviews the code and then pulls it in.

Is this a reasonable work flow? My concern is that the forked repos don't automatically get updated when the group repo gets updated. Would it be better if everyone contributed directly to the group repo? If so, is there a way to use GitHub for convenient code reviews?

Upvotes: 5

Views: 1347

Answers (1)

user229044
user229044

Reputation: 239240

Each developer always has their own fork; every clone is a full fork. Forking the repo in Github as well means that every dev has two forks, with a lot of redundant pushing and pulling between their local fork and their Github fork.

There's very little value to this. Forks on Github are great when you expect to have multiple developers pushing and pulling, or when you don't have the ability to simply push a branch to the original repo and open a pull request.

Within a single Github repository, you can open pull requests for branches. Typically your developers would work locally on a feature branch, push that branch to the shared remote, and then open a Github pull request to merge that branch into master.

Upvotes: 5

Related Questions