【发布时间】:2020-06-16 11:09:18
【问题描述】:
我已经用我正在运行的 git git version 2.16.2.windows.1 从 github 克隆了我的 repo。
但是,当我想提交它时,我收到以下错误:
error: open("src/hoc/Aux.js"): No such file or directory
error: unable to index file src/hoc/Aux.js
fatal: adding files failed
您可以在下面找到文件夹和文件内容:
任何建议我做错了什么?
感谢您的回复!
更新
请在下面找到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)
更新 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)
【问题讨论】:
-
你在做什么来提交你的工作?
-
@TimBiegeleisen
git add -A -- .&&git commit -m "message"&&git push origin master... -
@TimBiegeleisen 但是,该命令无法通过
git add -A -- .,因为git commit只是添加了一个空文件夹... -
git status是否表明文件实际上已被暂存? -
@TimBiegeleisen 请看我的更新
标签: git