当我尝试将上游分支变基为主题分支时遇到问题。工作流程是这样的:
git checkout upstream
git pull origin upstream
git checkout topic
git rebase upstream
结果如下:
First, rewinding head to replay your work on top of it...
Applying Refactored database access and added logging
error: patch failed: path/to/file1.ext:21
error: path/to/file1.ext: patch does not apply
error: path/to/file2.ext:3
error: path/to/file2.ext: patch does not apply
fatal: mode change for path/to/file3.ext, 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 0001.
我昨天就遇到了这种情况,我做了研究,但什么也没发现,所以最后我用了git merge upstream
代替git rebase upstream
事情成功了。真正的问题是今天也出现了该错误。由于昨天的合并,我已经与上游同步。另外,从昨天开始我就没有修改过队友介绍的文件。
我的 Git 版本是 1.5.6.5(并且不太想在本机上更新它,我担心会产生不良后果)。
我发现用--merge
在这种情况下,选项会有所帮助。 (尽管如此,Git 仍会执行变基操作。)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)