我目前正在使用 git rebase -i
merge 两个分支, 有一个提交不允许我继续 rebase。当我检查提交时,我看到有一些文件但没有与分支冲突。
我尝试使用 fixup
和 edit
因为我想也许我做了一些改变,但事实并非如此。当我跑 git rebase --continue
我收到以下消息:
error: The following untracked working tree files would be overwritten by merge:
它还显示如上图所示的文件,并带有以下消息
Please move or remove them before you merge.
Aborting
hint: Could not execute the todo command
hint:
hint: pick 430847f3fe3f80162a93f62db3e016f3c9a97cc1 Include html2text package
hint:
hint: It has been rescheduled; To edit the command before continuing, please
hint: edit the todo list first:
hint:
hint: git rebase --edit-todo
hint: git rebase --continue
在这种情况下我能做什么?这是否意味着,我可以重新提交此提交?我必须堕胎吗?
最佳答案
error: The following untracked working tree files would be overwritten by merge:
这正是它所说的意思:某些文件存在于您的工作树中但不在您的索引中,因此它们未被跟踪。继续下一个
git cherry-pick
那是 git rebase
的一部分序列将覆盖它们。 (这里主要的棘手之处在于 git rebase
主要由一系列 git cherry-pick
命令组成,而 git cherry-pick
使用 Git 的 merge 机制,因此即使您正在执行 git rebase
您也会 merge 一些文件.)... But I don't see those file in the folder it says the are. There is no
vendor/soundasleep
folder when I check atom ...
这才是真正令人费解的部分。 Git 肯定会将文件视为存在于您的工作树中。请注意,如果您使用的是典型的 Windows 或 MacOS 系统,底层文件系统会进行大小写折叠,因此如果存在
vendor/SoundAsleep
文件夹,或 VENDOR/soundasleep
文件夹或任何类似的东西,这也很重要。(我不使用原子编辑器,我自己会在它之外进行任何检查。)
关于git - 由于未跟踪的工作树文件将被 merge 错误覆盖,因此无法继续 rebase,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58492203/