我一直在开发一个ASP.NET核心应用程序,我正试图将它推向GitHub。在GitHub桌面中,当我尝试提交更改(初始提交)时,我一直收到以下警告和错误:
warning: LF will be replaced by CRLF in .gitattributes.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/presentation/abcl.WebApi/appsettings.Development.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in src/presentation/abcl.WebApi/bin/Debug/net5.0/appsettings.Development.json.
The file will have its original line endings in your working directory
error: invalid path 'src/presentation/frontend/'
error: src/presentation/spa/: cannot add to the index - missing --add option?
fatal: Unable to process path src/presentation/spa/项目根目录为C:\abcl,提供错误的文件夹的完整路径为C:\abcl\src\presentation\spa。
我试过将“spa”文件夹更改为各种不同的名称,但这似乎没有什么区别。我没有看到任何非法字符在这条道路上,也不明白它如何可能是无效的。我尝试迁移到项目根并在CLI中运行git config core.protectNTFS false,但没有骰子。
我对GitHub非常陌生,所以不太确定该做什么。
使用CLI编辑,我可以获得其他文件提交,但出于某种原因,它不喜欢这个abcl/presentation/spa目录。在github上,它显示为一个带有箭头的文件夹(这是一个符号链接吗?)我无法访问它的内容。

发布于 2021-10-30 23:54:46
github上的
显示为一个带有箭头的文件夹(这是一个符号链接吗?)
它是一个gitlink,一个嵌套Git存储库的根树的表示。
检查是否有spa\.git子文件夹,并删除它(假设您对所述子文件夹的历史不感兴趣)。
然后:
git rm src/presentation/spa # no trailing /
git add src/presentation/spa
git commit -m "Add src/presentation/spa"
git pushhttps://stackoverflow.com/questions/69782746
复制相似问题