mvn jgitflow:release-finish is merging release --> master --> develop

4.9k Views Asked by At

When I was using

mvn jgitflow:release-finish

I noticed that the release branch got merged into master branch.

Question: Is this the correct way?

Sorry my questions might be naive as I am new to this. I was thinking that the code from release branch will merge to develop and master and not like release --> master --> develop.

Question: What if I don't want this to happen and instead I should be in a position to rebase develop from master?

1

There are 1 best solutions below

0
On BEST ANSWER

When I was using mvn jgitflow:release-finish I noticed that the release branch got merged into master branch. Is this the correct way?

This is the correct way according to the main philosophy behind, gitflow:

Release branches

  • May branch off from:develop
  • Must merge back into: develop and master

And according to the plugin documentation, the release-finish indeed merges back to the master and dev branch:

finishing a release - runs a maven build (deploy or install), merges the release branch, updates pom(s) with development versions

This makes sense, because (again back to gitflow):

When the state of the release branch is ready to become a real release, some actions need to be carried out. First, the release branch is merged into master (since every commit on master is a new release by definition, remember). Next, that commit on master must be tagged for easy future reference to this historical version. Finally, the changes made on the release branch need to be merged back into develop, so that future releases also contain these bug fixes.


I was thinking that the code from release branch will merge to develop and master and not like release --> master --> develop.

The order follows this flow (first master, then develop) because it's a release and as a release it must firstly go to master (which should always represent the released code base), then to develop (whish is the next potential release code base).


What if I don't want this to happen and instead I should be in a position to rebase develop from master.

You can use the noReleaseMerge option:

Whether to turn off merging changes from the release branch to master and develop

Default value is to false, hence by default merges are performed. However, the option covers the two merges, you cannot disable only one of them, it's either both (again, following gitflow philosophy) or none. This option may suit your needs but you would then perform additional actions via git commands.