主题分支中的“git rebaseupstream-branch”发生致命错误

发布于 2024-09-14 00:57:32 字数 873 浏览 5 评论 0原文

当我尝试将上游分支变基为主题分支时遇到问题。工作流程是这样的:

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 rebaseupstream 一切顺利。真正的问题是今天也出现了该错误。由于昨天的合并,我已经与上游同步。另外,从昨天开始我就没有修改过队友介绍的文件。

我的 Git 版本是 1.5.6.5(并且不太想在本机上更新它,我担心会产生不良后果)。

I have an issue when I try to rebase an upstream branch into a topic branch. The workflow is like this:

git checkout upstream
git pull origin upstream
git checkout topic
git rebase upstream

The result looks like this:

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.

That happened to me yesterday, and I've done my research and found nothing, so in the end I used git merge upstream instead of git rebase upstream and things worked. The real problem is that the error appears today too. I'm already synchronized with upstream due to yesterday's merge. Also, I've not modified files introduced by my team mates since yesterday.

My Git version is 1.5.6.5 (and don't really feel like updating it on this machine, I'm afraid of the unwanted consequences).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

鯉魚旗 2024-09-21 00:57:32

我发现使用 --merge 选项进行变基在这种情况下会有所帮助。 (尽管如此,Git 仍会执行变基操作。)

I have found that rebasing with the --merge option helps in such cases. (Git will do a rebase nonetheless.)

陌伤浅笑 2024-09-21 00:57:32

我也遇到了同样的事情,结果是由消息中存在差异的提交消息引起的。

也许尝试: git log --grep ++

...看看是不是这样..

I had the same thing and it turned out to be caused by a commit message that had a diff in the message.

Maybe try: git log --grep ++

... see if that's it ..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文