【发布时间】:2021-04-22 22:23:54
【问题描述】:
我正在尝试将我的本地分支从不同的存储库合并到我的上游代码。我想在我的开发系统中将priv/dev 分支合并到origin/master。我想将我的更改优先于原始主机。但是它失败了,我的代码有错误吗?
git clone https://github.com/production public_code
cd public_code
git remote add priv https://gitlab.com/tmv/development
git merge -Xours priv/dev origin/master
输出
error: Merging is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
【问题讨论】:
-
没有“强制合并”之类的东西。这些命令失败时会出现什么错误?
-
明白,改了描述
-
“失败”是什么意思?运行这些命令后会发生什么?
-
输出为自动合并失败;修复冲突,然后提交结果。
-
问题是您正在将两个远程跟踪分支合并到本地主服务器中。我认为这不是你想要的。
标签: git git-merge git-remote