gitgit-flow

How to create a minor release with only some commits


I'm using the standard git flow.

In some cases I need to create a minor release choosing a subset of all the commits done in develop branch.

Let's say I closed my last release and merged it back to develop in commit X. Now I created new commits, x1,x2,x3,x4,x5

develop -------x----x1----x2----x3----x4----x5
release/3.4---/--\
master-----------y(tag 3.4)--------

I want to create release/3.5 adding only x1 and x4. What is the best solution?

My ideas (none of them seems totally right though):

  1. start from develop, revert the commits x2,x3,x5
  2. start from tag 3.4 in master branch and cherry-pick x1 and x4. at the end I don't merge back to develop (but I merge to master)

Solution

  • Option 2 looks right to me - you're effectively doing a hotfix in gitflow https://nvie.com/files/Git-branching-model.pdf