为什么`git rebase --continue`失败并出现gitmodules错误?

时间:2015-04-24 01:16:15

标签: git git-branch git-submodules

我创建了一个名为lab的分支,基于master。几个月后,我试图根据master改变实验室分支。首先是一个.gitignore冲突;解决之后,我运行git rebase --continue,但它再次失败,这次没有帮助信息告诉我如何继续这个rebase。如何根据master修改实验室分支?

git rebase --continue
Applying: start edit
Applying: a
fatal: mode change for .gitmodules, which is not in current HEAD
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0002 a
The copy of the patch that failed is found in:
   f:/testxxx/.git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

2 个答案:

答案 0 :(得分:1)

.gitmodules存在于一个分支上,而不存在于另一个分支上。查看补丁文件并查看哪个,然后使用git add或git rm来决定是否需要由于rebase而导致的.gitmodules文件。

答案 1 :(得分:0)

尝试使用--merge修饰符

运行rebase
git rebase --merge branchname