主题分支中的`git rebasestreaming-branch`致命错误 [英] Fatal error with `git rebase upstream-branch` in topic branch

查看:90
本文介绍了主题分支中的`git rebasestreaming-branch`致命错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试将上游分支重新建立为主题分支时,我遇到了一个问题.工作流程是这样的:

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

结果如下:

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

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.

我的Git版本是1.5.6.5(我真的不想在这台机器上更新它,我担心会产生不必要的后果).

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).

推荐答案

我发现,使用--merge选项重新设置基准在这种情况下会有所帮助. (尽管如此,Git仍会进行重新设置.)

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

这篇关于主题分支中的`git rebasestreaming-branch`致命错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆