git - 由于未跟踪的工作树文件将被合并错误覆盖,因此无法继续使用 rebase
问题描述
我目前正在使用 合并两个分支git rebase -i
,有一个提交不允许我继续使用变基。当我检查提交时,我看到有一些文件但没有与分支冲突。
我尝试使用fixup
andedit
因为我想也许我做了一些改变,但事实并非如此。当我运行时,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:
这正是它所说的:某些文件存在于您的工作树中但不在您的索引中,因此它们是untracked。git cherry-pick
继续作为序列一部分的下一个git rebase
将覆盖它们。(这里主要的棘手部分是git rebase
主要由一系列git cherry-pick
命令组成,并且git cherry-pick
使用了 Git 的合并机制,因此即使您正在git rebase
合并一些文件。)
...但我没有在它所说的文件夹中看到那些文件。
vendor/soundasleep
我检查 atom 时没有文件夹...
这才是真正令人费解的部分。Git 肯定会认为这些文件存在于您的工作树中。请注意,如果您使用的是典型的 Windows 或 MacOS 系统,则底层文件系统会进行大小写折叠,因此如果有vendor/SoundAsleep
文件夹或VENDOR/soundasleep
文件夹或任何类似的东西,这也很重要。
(我不使用原子编辑器,我自己会在它之外进行任何检查。)
推荐阅读
- java - 如何在单独的值中获取外部函数的值?
- cloudify - Cloudify Composer - 调整/重新排列节点或组件框的大小
- html - 为什么我的媒体查询在 WordPress Weaver Xtreme 主题中不起作用?
- c# - 从 UWP 应用中提取进程的图标
- javascript - 如何在我的 HTML 项目中添加 Node.js 结果?
- matlab - 如何编写以下函数,以便在放置变量值之前可以找到梯度
- javascript - 将 HTML 表格导出为 Excel 保持格式
- flutter - Flutter 如何处理 Image.network 错误(如 404 或错误的 url)
- c++ - 如何在 C++ 的 SDL 2 窗口中创建输入框?
- javascript - 获取 SectionList 项 React-Native 的索引