简体   繁体   中英

How do I check out files with special characters in the file name (e.g. ?) on Windows in Git while keeping the original name in the repo?

I have a bunch of files in a Git repo which works okay on macOS and Linux, but will fail on Windows because the file name contains ?

I was wondering how do I configure Git only on my local Windows machine so that I can check it out and have it auto convert the file to something Windows will allow and push it back preserving the file name?

The best way to do this is to use the Windows Subsystem for Linux. It has a fully POSIX-compatible file system and is fully capable of storing arbitrary byte values (with the normal exceptions).

It is almost certainly not going to be possible to use Git for Windows on a native Windows file system, although if you happened to format an external hard disk as UDF (which, I believe, requires the full disk, not just a partition, to be formatted that way on Windows), then you could probably check it out there. UDF is at least capable of handling these characters on Unix.

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