git 与子模块合并期间的问题

问题描述 投票:0回答:1
  1. 我想合并并接受另一个分支的所有更改。为什么我收到消息自动合并失败?在这种情况下,如何说 Git 只接受来自另一个分支的更改?
git merge --squash --strategy-option theirs anotherbranch
...
<list of files>
CONFLICT (submodule): Merge conflict in test/test_lib
...
Squash commit -- not updating HEAD

Automatic merge failed; fix conflicts and then commit the result.
  1. 之后我尝试中止合并并得到There is no merge to abort。怎么可能? Git 上面的一行让我修复冲突。但实际上我没有在我的文件中看到冲突标记。
git merge --abort
fatal: There is no merge to abort (MERGE_HEAD missing).
  1. 我尝试提交。
git commit -m "merge"

error: Committing 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.
  1. 在这种情况下我怎样才能中止合并?
git git-merge
1个回答
0
投票

根本原因是子模块test_lib。 如果你看到这样的消息

CONFLICT (submodule): Merge conflict in test/test_lib

用途:

git add test_lib
git commit -m "merge"
© www.soinside.com 2019 - 2024. All rights reserved.