在等待未决PR时工作 [英] Working while waiting for pending PR
问题描述
我正在开发一个项目,并且提交了我的第一个拉取请求,而我在等待时,我想继续处理我的项目,这些项目是根据我在合并中尚未完成的工作建立的。现在我有:
* master
user_story_1
user_story_1
有一个公开的拉取请求。
现在我试着创建一个新的分支 user_story_2
,我可以继续我在 user_story_1
。如何在Git中执行此操作而不会发生任何冲突或影响我的待处理合并? 我假设您想要在 user_story_1
中完成的工作之上启动新的 user_story_2
分支。下面是我在这种场景中使用的工作流程:
$ b
-
打开<
user_story_1 $ b $ $ $ $ $ $ $ $ $ b $ $ $ $ $ $ )
*
*
-
创建新分支
user_story_2
基于user_story_1
:
$ git checkout -b user_story_2 user_story_1
*(user_story_1,user_story_2)
*
/
* (master)
*
*
-
:
*(user_story_2)
*
*(user_story_1)
*
/
*(master)
*
*
-
Pull Request合并:
*(user_story_2)
*
* | (主)
| \ |
| *(user_story_1)
| *
| /
*
*
*
-
删除旧分支:
*(user_story_2)
*
* | (主)
| \ |
| *
| *
| /
*
*
*
-
将新分支重新分配到
master
:*(user_story_2 )
*
/
*(master)
| \
| *
| *
| /
*
*
*
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) |\ | * | * |/ * * *
ol>
I'm working on a project and I submitted my first pull request and while I'm waiting I want to continue on working on my project building up from what I worked on the merge that's still pending on. Right now I have :
*master
user_story_1
user_story_1
has an open pull request.
Now I'm trying to create a new branch user_story_2
where I can continue the work I left of at user_story_1
. How can I do this in Git without getting into any conflict or affecting my pending merge?
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:
这篇关于在等待未决PR时工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!