简体   繁体   English

主题分支中的`git rebase upstream-branch`发生致命错误

[英]Fatal error with `git rebase upstream-branch` in topic 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

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. 昨天发生在我身上,我已经完成了我的研究并没有发现任何东西,所以最后我使用git merge upstream而不是git rebase upstream ,事情很有效。 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). 我的Git版本是1.5.6.5(并且真的不想在这台机器上更新它,我担心不必要的后果)。

I have found that rebasing with the --merge option helps in such cases. 我发现使用--merge选项进行变基在这种情况下--merge帮助。 (Git will do a rebase nonetheless.) (尽管如此,Git还会做一些改变。)

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 ++ 也许试试:git log --grep ++

... see if that's it .. ......看看是不是..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM