【发布时间】:2015-05-26 15:41:20
【问题描述】:
我只想编辑/修改旧 Git 提交的文本。
我运行了以下内容:
$ git rebase -i a41a407d6f53328d49267e6a8429b9492f023629
error: The following untracked working tree files would be overwritten by checkout:
admin/roles/allowassign.php
admin/roles/allowoverride.php
admin/roles/assign.html
admin/roles/assign.php
admin/roles/manage.html
admin/roles/manage.php
admin/roles/managetabs.php
admin/roles/override.html
admin/roles/override.php
Aborting
could not detach HEAD
但是,git status 没有列出任何未跟踪的文件:
$ git status
On branch dev
nothing to commit, working directory clean
注意,admin/roles 是存储库的子模块:
$ git submodule
77c5addc1b210256da9171e3b286ffa5addd2478 admin/roles (heads/dev)
并列出被忽略的文件:
$ git status --ignored
On branch duf-moodle-dev
Ignored files:
(use "git add -f <file>..." to include in what will be committed)
blocks/moodleblock.class.php.bak
filter/tex/mimetex.exe
lib/smarty/COPYING.lib
nothing to commit, working directory clean
保存 GIT 存储没有结果:
$ git stash save --include-untracked
No local changes to save
我在读,集成到 Explorer Shell 中,可以有这样的结果。 目前 Git Extensions、GIT GUI 和 SmartGIT 已集成到上下文 shell 中。 这可能会导致问题?
我的建议是,问题的根源在于子模块的使用。 我将一些更改保留为子模块。
任何想法为什么 rebase 交互会给出错误以及如何修复它?
此外,如果有一个解决方案来编辑/修改旧的提交描述而不使用 rebase...
【问题讨论】:
-
git status --ignored显示什么? -
将
git status --ignored结果添加到原始帖子中。 admin/roles/... 没有什么共同点 -
@klor 由于我的回答没有帮助,我会删除它,至少现在是这样。
-
我打算停止使用子模块。我希望,如果我停止使用子模块,这些问题就会消失。但是,没有简单的方法可以将子模块存储库合并到我的父存储库:-(
-
但是,当我尝试将子模块合并到主仓库,然后将子模块的最旧提交重新定位并粘贴到主仓库的最后提交时,我收到“错误:以下未跟踪的工作树文件将被结帐覆盖”。 “Catch-22”已关闭。有什么想法吗?