Git – code review with git-flow and github

code-qualitycode-reviewsgitgitflowgithub

With regular git and github I can do a code review by simply creating a pull request of the feature branch I'm working on to the master branch. How would I do code reviews with git-flow? With workflow like "git flow feature finish` I'm confused as to where the code review actually happens and how git-flow or git can facilitate that review.

Best Answer

We stumbled on this exact problem recently. We really like git flow, as it use a good level of semantic (using the same level that you use in team discussion : "I'll start feature A" more than "I'll create a branch, checkout it"), while git is very "implementation" level (which is good and useful also, but different).

The problem we have is with git feature finish, as it merge the branch into the develop, while we want a pull request to be sent and (this is important) merged by the reviewer, not the committer, to emphasize team ownership.

Our current solution :

  1. Someone use git flow to create a feature branch
  2. When done, he create a pull request (using github)
  3. The review take place, with potential additional commits
  4. The pull request is merged using GitHub by the reviewer.
  5. There is not git flow feature finish (as the branch is already merged)

This is consistent with our practice, with the downside of requiring to delete the branch ourselves (as we do not git flow finish). Our next step will probably be to reimplement some parts of git flow (as it is mainly about chaining git commands) to take this into account (having the "cleaning" part of the finish, without the merge).

Related Topic