我有一个带有子模块的git代码库。我需要弹出之前存储的更改,但这会导致子模块引用上的合并冲突。
我想保留我的stash中的更改,除了子模块。对于大多数代码文件,我可以通过编辑冲突的文件来解决冲突,但这似乎不适用于子模块。
如何解决合并冲突并仍然从stash中提取我的更改?
$ git stash pop
warning: Failed to merge submodule some-submodule (commits don't follow merge-base)
Auto-merging some-code
Auto-merging some-submodule
CONFLICT (submodule): Merge conflict in some-submodule
$ git status
# On branch some-branch
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: some-code
#
# Unmerged paths:
# (use "git reset HEAD <file>..." to unstage)
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# both modified: some-submodule
git reset HEAD some-submodule/
,但没有成功( shell 的自动补全会为目录添加一个斜杆)。我不得不去掉这个斜杠。 - Mashmagar