git - Git 错误:与 git 已知的任何文件都不匹配
问题描述
我不得不重新安装 Visual Studio,因为这是我第一次需要使用 Web Deploy 在我们的 Azure 实例(Episerver 网站)上部署我的代码,所以我不得不重新输入我的登录信息。
在 Git 中,我现在看到以下状态(注意这是指 FTP):
修改:
Project/Project.Site/Properties/PublishProfiles/a1di01mstr04ixqinte - FTP.pubxml
由于我们不使用 FTP,我不希望提交任何这些更改。事实上,在 Visual Studio 中,没有任何文件显示为已更改。
我试图通过执行以下操作不签出此文件:
git checkout -- Project/Project.Site/Properties/PublishProfiles/a1di01mstr04ixqinte
但我得到了错误:
错误:pathspec 'Project/Project.Site/Properties/PublishProfiles/a1di01mstr04ixqinte' 与 git 已知的任何文件都不匹配
解决方案
我猜您没有提供git checkout
命令的完整路径,因为错误消息中缺少“-FTP.pubxml”。如果您有带空格的路径,则应使用引号。
git checkout -- "Project/Project.Site/Properties/PublishProfiles/a1di01mstr04ixqinte - FTP.pubxml"
推荐阅读
- mysql - 将单个字段拆分为多个字段
- php - localhost 根据传递的参数重定向到特定文件夹
- .net - docker 容器的 CPU 利用率低
- python - 不明白为什么会出现错误“NameError: name 'raw_input' is not defined”
- python-3.x - 如何比较python中多个列表的相同索引处的变量
- iis - 在iis中重定向到www?
- python - 为什么我的正则表达式没有返回任何匹配项?
- python - 建议在 python 3.6 脚本和 python 2.7 脚本之间传递数据
- symfony - Symfony JMS Serializer - 上传文件的端点
- java - 请求 HttpResponse 时 Android 应用程序崩溃