0

We use GitLab and its MRs. We use a gitflow (just without release branches). Master is our production branch and develop the current dev branch. Master and develop are protected on GitLab so any push is impossible.

My concern is about the way to update master with develop. Because merging an MR behind the target branch is disable (you have to rebase), how can we update the master with develop with an MR when a hotfix is being merged in master? The develop branch is then behind the master and merge is impossible. The local merge is then necessary and we need to grant the push right to administrator?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
MuyBien
  • 163
  • 2
  • 13
  • Turn this off: Because merging an MR behind the target branch is disable – jessehouwing Jan 12 '22 at 13:19
  • Yes one solution is this. But there is still a problem : how to handle conflict? An hotfix on master and a feature on dev are in conflict. Because dev and master are protected you cannot merge in local. How to be "sure" to not be in conflict with master? – MuyBien Jan 12 '22 at 14:31
  • 1
    You can't. It's one of the problems of the GitFlow model which keeps multiple branches around for a long time. If needed, create a temporary branch from dev, merge master into that and merge that into dev with a MR. In git, with parallel development, you can't prevent having to merge branches once in a while. – jessehouwing Jan 12 '22 at 14:37
  • OK. Yes it's true that I always want to be update with the target branch but maybe it's not required for merge from dev to master... – MuyBien Jan 14 '22 at 10:45
  • You'll need to merge at some point... – jessehouwing Jan 14 '22 at 11:18
  • What do you mean? master into dev? – MuyBien Jan 15 '22 at 17:07
  • One way or the other. You'll need to sync up the branches for the next merge to succeed with a MR/PR if you won't allow non fast forward merges. – jessehouwing Jan 15 '22 at 17:30
  • I think I will allow the fast forwrd merges... But then I have all the commit merge on master that are behind dev... How to update dev? Rebase ? Merge master in dev ? Do I need to update dev with master? Pffff it's complicated – MuyBien Jan 15 '22 at 20:08

0 Answers0