首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >(Github桌面Win64)试图向新存储库提交更改时出现的“无效路径”错误

(Github桌面Win64)试图向新存储库提交更改时出现的“无效路径”错误
EN

Stack Overflow用户
提问于 2021-10-30 22:55:45
回答 1查看 1.6K关注 0票数 4

我一直在开发一个ASP.NET核心应用程序,我正试图将它推向GitHub。在GitHub桌面中,当我尝试提交更改(初始提交)时,我一直收到以下警告和错误:

代码语言:javascript
复制
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上,它显示为一个带有箭头的文件夹(这是一个符号链接吗?)我无法访问它的内容。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-10-30 23:54:46

github上的

显示为一个带有箭头的文件夹(这是一个符号链接吗?)

它是一个gitlink,一个嵌套Git存储库的根树的表示。

检查是否有spa\.git子文件夹,并删除它(假设您对所述子文件夹的历史不感兴趣)。

然后:

代码语言:javascript
复制
git rm src/presentation/spa # no trailing /
git add src/presentation/spa
git commit -m "Add src/presentation/spa"
git push
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69782746

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档