I use git flow and I have a question about best practice when branching making feature branches. If I have a develop main branch and two feature branches, one branched at time t2 and the other branched at t3, what should be done if both feature branches are not ready to merge and need something new from the develop branch or from the other feature branch? Is there a way to update the "base" of feature 1 from develop at t2 to a new "base" of develop at t3 when something new has been done with develop? And similarly for feature branch 2, when it is not ready for merging, can it be updated with new changes from the develop branch before we merge it?
feature 1 (branch)
/
/
----- develop ----/-----\---------------------------
\
\
feature 2 (branch)
t1 t2 t3 t4
Can the branches somehow be "moved forward" so that new changes in develop branch get included with the feature branches or is it necessary that we merge first?
I want to complement the two existing answers: instead of merging
develop
in thefeature
branches, you could also instead rebase eachfeature
branch on the updateddevelop
branch:Advantages:
feature
intodevelop
.feature
branch (e.g. if you want to fix a typo in a commit message) without changing the commits already in thedevelop
branch. If you mergedevelop
intofeature
, this is no longer possible, because the branches will then diverge and you can no longer mergefeature
intodevelop
.So this approach is slightly more work (rebase instead of merge), but also brings some (minor) advantages.