We use GitHub Flow in our project and most of the time, we open a new feature branch from master, do some work there, open a PR, review the code and merge back into master.
However, my current work depends on another issue that is being worked on in feature-branch-A
. Is it kosher to create my branch from that other branch or is that against the spirit of GitHub Flow?
The alternative would be to base my branch on master and merge-in the changes from feature-branch-A
(frequently).
Which option is preferred in GitHub flow?
Best Answer
Here is the workflow that I follow when I branch from a feature branch:
feature-branch-B
fromfeature-branch-A
feature-branch-B
feature-branch-A
after branching, rebasefeature-branch-B
ontofeature-branch-A
feature-branch-B
and wait tillfeature-branch-A
is merged intomaster
.feature-branch-A
is merged intomaster
, rebasefeature-branch-B
ontomaster
feature-branch-B
intomaster
By following the above workflow it will appear that you branched from
master
afterfeature-branch-A
was merged. You don't have to wait tillfeature-branch-A
is merged to start work onfeature-branch-B
. Yet, you will get a clean history without any complicated trees.