git克隆代码时仓库文件存在中文名报错java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters如何解决
时间: 2023-08-23 21:36:55 浏览: 87
出现这个异常的原因是 Git 在处理中文文件名时出现了编码问题,可以通过设置 Git client 的文件系统编码方式来解决。具体操作如下:
1. 在命令行中执行以下命令,设置 Git client 的文件系统编码方式为 UTF-8:
```
git config --global core.quotepath false
git config --global core.longpaths true
git config --global core.preloadindex true
git config --global core.fscache true
git config --global core.protectNTFS false
git config --global core.ignoreCase true
git config --global core.autocrlf false
git config --global core.safecrlf true
git config --global core.packedGitLimit "512m"
git config --global core.packedGitWindowSize "512m"
git config --global pack.windowMemory "512m"
git config --global pack.packSizeLimit "512m"
```
2. 如果使用的是 Git GUI 客户端,可以在设置中找到文件系统编码方式,将其设置为 UTF-8。
设置完成后,再次进行 Git 克隆操作,就可以避免中文名导致的 java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters 异常了。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)