首页 > 解决方案 > Git 在 rebase 上将跟踪的文件列为未跟踪的。我该如何执行这样的变基?

问题描述

当我尝试git rebase branch1 branch2, 或之后git checkout branch2, 时git pull origin branch1 --rebase,我收到以下消息:

error: Your local changes to the following files would be overwritten by checkout:
<list of files here>
Aborting
fatal: Could not detach HEAD
First, rewinding head to replay your work on top of it...

但是,当我运行 git status 时,什么也没有出现。如果我尝试签出不同的分支,它会起作用。如果我删除这些文件,它们会在 git 状态中显示为已删除,因此 rebase 仍然失败。当我存储更改时,情况与最初描述的相同。

我试过跑步git clean -fd。重命名索引文件,以便创建一个新的。我检查了文件在.gitignore file.

问题可能出在哪里?

标签: git

解决方案


推荐阅读