I'm assuming you want to start the new
user_story_2
branch on top of the work you've done in user_story_1
. Here's the workflow I use in this sort of scenario:- Open Pull Request for
user_story_1
:* (user_story_1) * / * (master) * *
- Create new branch
user_story_2
based onuser_story_1
:$ git checkout -b user_story_2 user_story_1
* (user_story_1, user_story_2) * / * (master) * *
- Work on the new branch:
* (user_story_2) * * (user_story_1) * / * (master) * *
- Pull Request gets merged:
* (user_story_2) * * | (master) |\| | * (user_story_1) | * |/ * * *
- Delete old branch:
* (user_story_2) * * | (master) |\| | * | * |/ * * *
- Rebase new branch onto
master
:* (user_story_2) * / * (master) |\ | * | * |/ * * *
from : https://stackoverflow.com/questions/35790561/working-while-waiting-for-pending-pr
user_story_2
ontomaster
:git rebase --onto master user_story_1 user_story_2
-- might result in conflicts if the two branches aren't completely independent. – alextercete Dec 22 '16 at 16:36git rebase -i master
, and it should show you a list of commits onuser_story_2
including the earlier commits fromuser_story_1
. Remove thepick
lines for commits fromuser_story_1
, and complete the rebase. – Athyuttam Eleti Feb 25 at 18:00user_story_1
? I guess after that we checkout touser_story_2
and rebase withuser_story_1
? – truongnm Jun 19 at 9:32user_story_1
hasn't been merged tomaster
yet). – alextercete Jun 25 at 8:07