I recently finished merging a release branch to master and develop using jgitflow:release-finish
. The build was successful.
But now I am trying to create a new branch using jgitflow:releast-start
. But it is giving the below error.
[ERROR] Failed to execute goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-start (default-cli) on project <XXXXXXX>: Error starting release: Error starting release: a release branch [refs/remotes/origin/release/1.0.1] already exists. Finish that first! -> [Help 1]
It asked me the below question when I ran jgitflow:release-start
and I entered it as 1.0.2.
What is the release version for "XXXXXXX"? (org.XXX.automation:XXXXXXX) [1.0.2]: 1.0.2
But still it is giving the below error. I am puzzled.
Questions:
Use the “git flow release start” command to create the release branch. When the release is stable, run the “git flow release finish” command. $ git flow release finish '0.1. 0' Already on 'master' Deleted branch release/0.1.
A release branch is created from develop. Feature branches are created from develop. When a feature is complete it is merged into the develop branch.
The release branch helps isolate the development of an upcoming version and the current release. The release branch's lifetime ends when a particular version of a project is released. Once this branch merges into the develop and main branches, it can be deleted.
1) Should we delete the release-1.0.1 branch manually? 2) If yes, I will losing the history. Is there any way to preserve that?
According to gitflow, the philosophy behind this Maven plugin, release branches are meant to be temporary branches which should be deleted afterwards:
Now we are really done and the release branch may be removed, since we don’t need it anymore:
$ git branch -d release-1.2 Deleted branch release-1.2 (was ff452fe).
Changes for release preparation and complition are then merged, hence history of its changes is in most of the cases irrelevant.
However, a different approach is possible as a variant of gitflow (but obviously not directly supported by the plugin): keep a long living release branch, used for all releases and rebase
it from the develop
branch instead of creating a new one when ready to prepare/perform a release.
Also note that the release:finish
goal provides a keepbranch
option:
Whether to keep the release branch after finishing the release.
Default value to false
, hence by default it should not keep the release branch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With