When using a feature-branch based rebase workflow, how can I keep a branch for minor changes in the master?

70 Views Asked by At

I used to use a merge workflow and my current team works with a rebase workflow.

In it, features branches are forked from the master, then rebased with the master and then squash merged onto the master.

I would like to keep a branch for minor changes onto the master that I could easily fit in the feature branches, though, I am unsure about what is the solution that will bring me less problems:

  1. fork minor_changes from the master and then merge it onto my feature branches (potentially many of them), and later squash merge the feature branches onto the master.
  2. fork minor_changes from the master and then rebase the - potentially many - feature branches with minor_changes, and later squash merge the feature branches onto the master.

I do not know if the first option will cause me any trouble, and I suspect that the 2nd one might duplicate commits in the final history.

Which is the best way to take care of this?

1

There are 1 best solutions below

4
On BEST ANSWER
  1. Checkout ( what you mean by "fork" a branch ) minor_changes branch from master.
  2. As changes occur on master rebase minor_changes branch on to master. You could set it up to track the master branch with git branch -u origin/master minor_changes then simply run git pull --rebase to keep it updated.
  3. Checkout feature branches from minor_changes branch.