git - 由于未跟踪的工作树文件将被 merge 错误覆盖,因此无法继续 rebase

标签 git

我目前正在使用 git rebase -i merge 两个分支, 有一个提交不允许我继续 rebase。当我检查提交时,我看到有一些文件但没有与分支冲突。

enter image description here

我尝试使用 fixupedit因为我想也许我做了一些改变,但事实并非如此。当我跑 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/

相关文章:

公司网络上的 git SSL 问题

git - 尝试将 fork 与上游存储库同步时出现 "You are not currently on a branch"错误

git log - 行太长 - 没有换行符

git - 如何使用 git 推送到 bitbucket 上的特定分支

GIT 警告 : too many files skipping inexact rename detection

git - TeamCity 将功能分支推送到 master 分支

svn - 'rm' + 'svn update' 在 Git 中等效?

git - 如何在 Azure DevOps 中设置分支名称的默认模板

git - 无法使用 git 存储库创建网站并从 Team Foundation 服务发布

php - 如何在 OpenShift 上作曲更新?