简体   繁体   中英

git can't checkout file with weird extension

I need clone/checkout a git repository from a local server, but that repository contains a file with the following extension

asmx?wsdl

And I receive an error message from 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'

How can I solve this? I need that file

I am assuming you are using Windows. Windows can not create files with "?" in the filename. Checking out under Linux or MacOS should work.

If desperate, you can get the file content with

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

where "master" is a branch that contains the file.

When you have the local copy so we can say the server then you can go the server directory in the project and you should be able to remove the file from the repo without cloning it.

So you can use git rm filename and commit and push your changes. When you then try to clone the repo it should work without that file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM