How should I incorporate a hotfix back into a feature branch using gitflow?

Posted by Mark Trapp on Programmers See other posts from Programmers or by Mark Trapp
Published on 2012-09-02T00:45:29Z Indexed on 2012/09/02 3:48 UTC
Read the original article Hit count: 381

Filed under:
|

I've started using gitflow for a project, and I have an outstanding feature branch as well as a newly created hotfix. Per the gitflow workflow, the hotfix gets applied to both the master and develop branches, but nothing is said or done about extant feature branches.

Nevertheless, I'd like to incorporate the hotfix changes back into my feature branch, which as near as I can tell leaves three options:

  1. Don't incorporate the changes. If the changes were needed for the feature branch, it should've been part of the feature branch.
  2. Merge develop back into the feature branch. This seems to follow the gitflow workflow the best, but would cause out-of-order commits.
  3. Rebase the feature branch onto develop. This would preserve commit order but rebasing seems to be completely absent from the general gitflow workflow.

What's the best practice here?

© Programmers or respective owner

Related posts about git

Related posts about gitflow