我已经完成了以下步骤:
>git checkout remote-branch-test
>git pull
>git checkout remote-branch
>git pull
>git merge remote-branch-test
Automatic merge failed; fix conflicts and then commit the result.解决了冲突
>git add .
>git commit
>git push origin remote-branch
**! [remote rejected] remote-branch -> remote-branch (you are not allowed to upload merges)
error: failed to push some refs to ....当我在远程服务器上执行git状态时
>git status
On branch remote-branch
Your branch is ahead of 'origin/remote-branch' by 37 commits.
(use "git push" to publish your local commits)我无法将更改推送到远程
我在这里错过了什么?
发布于 2021-10-13 19:48:25
通过以下步骤解决问题:
git获取git签出源/远程分支git合并
发布于 2021-10-13 01:32:58
这里有几件事要注意。博士指出
远程拒绝..。您不允许上传合并
这告诉我们,您的“远程”-the其他Git您要发送的提交-简单地禁止所有合并提交,句号。
然而,这种特殊的错误消息不是来自Git或GitHub,而是来自Gerrit。例如,请参见Gerrit:远程拒绝(您不允许上传合并),即使我允许“推送合并提交”。这意味着您没有使用GitHub进行推送。因此,github标记可能是不合适的。而且,由于Gerrit在Git之上添加了自己的一层内容,所以git标签也可能是不合适的。我在这里添加了格瑞特,但是您应该确保这些标记是正确的,并删除任何不合适的标记。
最后,合并添加多个提交是正常的:合并提交有两个父级,因此将一个合并提交添加到某个分支B通常会将N+1提交添加到B,其中N是从合并提交中可以到达的提交数,但在合并之前不能从B本身添加提交。因此,您的合并合并了一个现有的36次提交,加上合并本身,总共提交了37次。
https://stackoverflow.com/questions/69540821
复制相似问题