Daniel Böttner Daniel Böttner - 1 year ago 150
Git Question

Gitflow with Gitlab

I researched this topic quite a bit but was not able so far to find an answer.

We deployed a GitLab-CE appliance and are very happy with the decision so far.
We also follow and use the gitflow principles.

On thing which bothers me and which I would like to find a solution to is that
with gitflow, when a developer finishes a feature/bugfix/... with:

git flow feature finish foo

AFAIK git flow will merge the foo branch to develop. Which wont help when using GitLab for the Team.

Because on origin we currently protect master and develop. So it is not allowed to push to these branches.

Is there a way to alter the gitflow configuration or another kind of solution to combine gitflow with GitLab?

We als currently try to figure out which solution is the best to get CI up and going. When this is done, merges to develop could be allowed again.

Any links, tutorials and so on would be helpful.

Answer Source

The easiest solution would be to, instead of using the feature finish command, push the feature branch and make a merge request on GitLab. This will allow others to inspect the changes and merge them when everything is okay. The merging can be done locally using feature finish by the repository administrator, or using the online interface, which will do the same thing.

This will preserve Git Flow, as the merging pattern will be the same. The loose local feature branch can, after the merge, be removed, using either branch -d or feature finish.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download