Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jgitflow:release-finish is not deleting the release branch

I recently finished merging a release branch to master and develop using jgitflow:release-finish. The build was successful.

enter image description here

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:

  • Should we delete the release-1.0.1 branch manually?
  • If yes, I will losing the history. Is there any way to preserve that?
like image 383
Prakash P Avatar asked Jun 17 '16 11:06

Prakash P


People also ask

How do I complete a GIT release branch?

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.

What is the difference between feature branch and release branch?

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.

How does release branch work?

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 Answers

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.

like image 193
A_Di-Matteo Avatar answered Sep 17 '22 16:09

A_Di-Matteo