我有2个分支-master和develop
我一直在我的develop分支中执行一些拉取请求,其中包含5个项目,其中与master中的项目数相同.
I have been doing some pull requests in my develop branch where it contains 5 items, in which it is the same as the number of items in master.
但是,有人在master分支中做了一些提交并将pushed放入了更多项目,因此,现在有8个项目.
However, someone did some commits and pushed in a few more items into the master branch, and hence now it has 8 items.
由于我在develop中的请求还没有被批准/合并,每当我尝试更新请求时,我都会收到一条消息,提示This pull request can't be merged. You will need to resolve conflicts to be able to merge并要求我执行以下操作:
As my pull request in the develop is still not yet approved/merged, whenever I tried to update my pull request, I am getting the message stating that This pull request can't be merged. You will need to resolve conflicts to be able to merge and asked me to do the following:
git fetch origin master git checkout develop git merge FETCH_HEAD git commit git push origin HEAD这是在我推送"我的提交之后发生的,有时使我感到困惑.然后我意识到这是要我重新添加并重新提交其他3个新项目.那么这是否意味着我必须确保我的这两个分支之间的项目和内容应始终相同?我一直使用git pull/fetch,但是有什么更好的方法可以确保吗?
And this happens after I have 'pushed' out my commits, making me confused at times. Then I realized that it is asking me to re-add and re-commit in the additional 3 new items. So does this means I must ensure that the items and contents between these 2 branches of mine should be the same as always? I have always used git pull/fetch but will there be a better way for me to make sure?
推荐答案这意味着GitHub希望将您的PR分支合并到master中,但不能这样做,因为存在冲突.正如您在问题注释中讨论的那样,解决此问题的最佳方法(通常)是在命令行上将master分支合并到develop中.这将向您显示冲突并要求您解决它们.完成并推动该合并后,可以使用GitHub上的绿色按钮将PR合并回master.
What this means is that GitHub would like to merge your PR branch into master, but it can't, because there are conflicts. As you've discussed in the question comments, the best way to deal with this (usually) is to merge your master branch into develop on the command line. That will show you the conflicts and ask you to resolve them. Once you've completed and pushed that merge, the PR will be mergeable back into master using the green button on GitHub.
您可以简单地将您的deploy分支合并到master(我知道听起来更明智).在这种情况下,您将完全绕开PR.您必须关闭PR的未合并",然后分别将合并提交手动推送到master.
You could simply merge your deploy branch into master (which I realize sounds a bit more sensible). In that case, you'd be bypassing the PR entirely. You'd have to close the PR "unmerged", and separately you'd manually push the merge commit to master.
第一种方式,
更多推荐
Git在请求请求中发生冲突
发布评论