git无法以奇怪的扩展名签出文件

问题描述 投票:0回答:2

我需要克隆/签出来自本地服务器的git存储库,但该存储库包含具有以下扩展名的文件

ASMX?WSDL

我从git收到一条错误消息

error: unable to create file path/to/file/file.asmx?wsdl: Invalid argument
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

我怎么解决这个问题?我需要那个文件

git
2个回答
2
投票

我假设你使用的是Windows。 Windows无法使用“?”创建文件在文件名中。在Linux或MacOS下签出应该可行。

如果绝望,您可以获取文件内容

git show master:path/to/file/file.asmx?wsdl

其中“master”是包含该文件的分支。


0
投票

当你有本地副本,所以我们可以说服务器然后你可以去项目中的服务器目录,你应该能够从存储库中删除该文件而不克隆它。

所以你可以使用git rm filename并提交并推送你的更改。当您尝试克隆repo时,它应该在没有该文件的情况下工作。

© www.soinside.com 2019 - 2024. All rights reserved.