【发布时间】:2016-09-14 21:03:23
【问题描述】:
在 Git 存储库中运行 git status,我得到:
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
deleted: path/to/file1.sql
deleted: path/to/file2.sql
deleted: path/to/file3.sql
Untracked files:
(use "git add <file>..." to include in what will be committed)
path/to/file1.sql
path/to/file2.sql
path/to/file3.sql
no changes added to commit (use "git add" and/or "git commit -a")
所有其他文件都很好。 我已经尝试过重置、签出等,还再次克隆了存储库(我们使用集中式服务器)。没有什么能解决问题,但仅适用于使用 Windows 的特定用户。 Linux 上没有出现此问题。
附加信息:
-
git diff没有显示输出。 - 我已经尝试将
core.autocrlf设置为 false。
【问题讨论】:
-
这肯定没有行尾问题,因为这样文件只会显示为已修改,而不是已删除且同时未跟踪。我更怀疑这里有套管问题。路径真的相同吗,还是大写/小写有区别?
-
向我们展示你的 .gitignore 和
git log -- path/to/file1.sql path/to/file2.sql path/to/file3.sql的输出 -
这是在您对工作目录进行更改之后,还是在签出分支/克隆存储库时立即发生?
-
版本信息(适用于 Git 和 Windows)在这里可能很重要。 (我不知道发生了什么,只是提供更多信息的建议。)
-
在我的情况下,
git diff显示了一些结果,但似乎是将文件上移了一个目录的结果,git rm解决了问题