无法索引文件

Ann*_*lee 8 git

我用我正在运行的git从github克隆了我的repo git version 2.16.2.windows.1.

但是,当我想提交它时,我收到以下错误:

error: open("src/hoc/Aux.js"): No such file or directory
error: unable to index file src/hoc/Aux.js
fatal: adding files failed
Run Code Online (Sandbox Code Playgroud)

您可以在下面找到文件夹和文件内容:

在此输入图像描述

有什么建议我做错了吗?

感谢您的回复!

更新

请在下面找到git status给我的东西:

$ git status
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        .gitignore
        README.md
        config/
        package-lock.json
        package.json
        public/
        scripts/
        src/

nothing added to commit but untracked files present (use "git add" to track)
Run Code Online (Sandbox Code Playgroud)

更新1

即使手动添加src文件夹,我仍然会得到相同的错误:

marcus@Marcus-PC MINGW64 ~/Desktop/Coding Projects/demo-react-burger-builder (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        .gitignore
        README.md
        config/
        package-lock.json
        package.json
        public/
        scripts/
        src/

nothing added to commit but untracked files present (use "git add" to track)
Run Code Online (Sandbox Code Playgroud)

axi*_*iac 18

OP 对此答案的评论揭示了原因:

我现在删除了aux.js,现在一切正常.

AUX是Windows中的一个特殊文件名(继承自MS-DOS的旧时代).它是一个表示设备的特殊文件.在其他操作系统(基于Unix)上,特殊设备文件位于/dev目录中,MS-DOS(及其后续Windows)识别任何目录中的名称并将其视为特殊文件.这肯定发生在命令提示符(为了与旧的MS-DOS程序兼容),但它似乎也发生在其他上下文中.

该名称在任何目录中都是特殊的并且可以识别,处理文件名的操作系统代码会忽略提供的aux.js文件(及其路径)并aux作为特殊设备文件处理AUX.个性外壳并不重要,在Windows文件系统auxAux是一样的AUX.因为它认为它找到了一个特殊名称,所以它忽略了文件扩展名.

同样的事情发生了NUL,CON,PRN和其它特殊名字.点击此处查看完整列表:https://en.wikipedia.org/wiki/Device_file#MS-DOS

没有解决方案,只有解决方法.如果你被卡在Windows上或者项目是由同事在Windows上开发的,那么规避这个问题的唯一方法就是避免使用这些特殊名称.Aux可能是缺点Auxiliary.
使用更长的名字.


2003年,微软高级开发人员Raymond Chen在他的博客"The Old New Thing"中撰写了一篇有趣的阅​​读(以及提供我在这个答案中提供的信息的智慧之源).