我有一个远程存储库和一个本地副本。假设我在不同的本地分支机构开发了 2 个功能:
功能1
功能2
现在我已经完成了它们并将它们推送到远程存储库以进行 pull 请求。现在我需要实现一个依赖于 feature1
和 feature2
的 feature3
。
在本地计算机上继续它的正确方法是什么?例如,我不想在我的 feature1
或 feature2
pull 请求被取消的情况下产生一些副作用。
最佳答案
which depends on feature1 and feature2.
What is the right way to continue it on local machine?
您没有太多选择(继续在本地工作):您 merge f1 和 f2,并从那里创建 f3。
I dont want to have some side-effect in case my pull-requests of feature1 or feature2 will be canceled.
假设 f1 或 f2 被接受,您将:
- 从上游获取(您 fork 的原始存储库)
在upstream/master之上rebase f3提交(将包括f1或f2)
git rebase --onto upstream/master $(git merge-base f1 f3) f3
从缺失的功能中添加最少量的代码,以便 f3 重新工作。
关于git - 在本地与卡在 pull 请求中的本地分支远程工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57737748/