添加后 git 仍未跟踪
每次我执行 git status 时,这个文件夹都会显示为未跟踪。
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# src/error/
nothing added to commit but untracked files present (use "git add" to track)
即使在执行 git add . 、 git commit -a 后, src/error 处的文件夹仍然显示为未跟踪。每当只有此文件夹不断出现问题时,就会提交其他未暂存的文件。 git 也不会报告任何错误。这里可能有什么问题?
Everytime I do git status there is this folder that appears as untracked.
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# src/error/
nothing added to commit but untracked files present (use "git add" to track)
Even after doing git add .
, git commit -a
the folder at src/error keeps showing up as untracked. Other unstaged files get commited everytime only this folder keeps giving problems. Also git doesnt report any errors. What could be the problem here ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我发现了问题和解决方案,这就是发生的情况:
当我在本地更改大小写时,第一个 src/error 被称为 src/Error ,文件夹名称已更改,但在 git 中它仍然被提交为 src/Error 。 Windows 不区分大小写,因此我所做的是删除文件夹提交并使用正确的大小写再次添加它。
I found the problem and the solution this is what happened:
First src/error was called src/Error when i changed the case locally the foldername was changed but in git it was still commited as src/Error. Windows is case-insensitive so what i did was remove the folder commit and add it again with the right casing.
文件夹是否为空,如果是正常情况,请参阅此处
Is that the folder empty if so it is normal, see here
我已经在 Windows 7 控制台中尝试了以下操作,它有效,即它没有将
\src\error\
显示为未跟踪。这并不能回答您的问题,但我认为查看完整的分步示例可能会有所帮助。
I've tried the following in a Windows 7 console and it worked, i.e. it did not show
\src\error\
as untracked.This doesn't answer your question, but I thought it might help to see a full step-by-step example.