Marty Wallace
Marty Wallace

Reputation: 35734

Using gitflow - how to prepare release

When using gitflow as a git workflow, considering all branches are branched from develop and merged into develop. When coming to a release, how should failed branches be dealt with.

For example, feature/my-feature-1 was merged into develop ready to be q/a tested.

meanwhile, feature/my-feature-2 was created from develop and worked on.

feature/my-feature-1 failed testing and cannot be part of an upcomming release.

However, feature/my-feature-2 already contains all of the history of feature/my-feature-1 since it was created from develop.

Therefore, the only possible way of creating a release branch would be to cherry pick the commits from feature/my-feature-2. Is this correct?

Is there a better way to do this or am i completely missing something?

Upvotes: 2

Views: 315

Answers (1)

BartBog
BartBog

Reputation: 1979

You probably want to do something like

git rebase --onto release develop feature/my-feature-2

which rebases my-feature-2 onto the release branch, while it was previously onto based on the develop branch

See "more interesting rebases" on https://git-scm.com/book/en/v2/Git-Branching-Rebasing

Upvotes: 1

Related Questions