0

I am new to using git-flow and have got some queries. Let's say I have master & dev branches created upon git flow init and feature/master-api branch made from dev branch.

Once I complete the feature I do git flow feature finish master-api. The feature branch gets merged into my local dev branch.

Are my team members supposed to create a new branch from dev and raise an MR to dev?

Same goes when doing git flow release finish 1.0.0.1. Code gets merged into local master branch and back-merged into local dev.

dev and master (maybe release/) branches are supposed to be protected branches.

So how do we manage MR for code reviews?

Praveen Kamath
  • 959
  • 2
  • 10
  • 18
  • Git by itself does not have a notion of branch protection. So this is usually not enforced (locally). It is possible to have remote servers restrict commits pushed to a certain branch to only contain merge commits though. – But I think if you want to establish branch protection and code review properly, then you just don’t use `git flow feature finish`. You just create a PR into the target branch yourself. – poke Mar 09 '19 at 10:08
  • 1
    That's the reason I feel `git flow` to be incomplete. Almost all organisations will have these branches protected to support code-reviews. `git flow` without `git flow feature finish` will just provide some branch naming conventions. – Praveen Kamath Mar 09 '19 at 10:16
  • 1
    Yes, Git Flow is just a set of conventions with a guideline for a workflow. It does not replace other things as part of your workflow if you want to enforce different things, and it’s generally also not a strict guideline that easily applies to _every_ project. You should evaluate what your project needs and then adjust the workflow to match your project. – poke Mar 09 '19 at 10:25

0 Answers0