[Problem] When git submits a file with a Chinese name, the Chinese name cannot be displayed after submitting the local library. Solution

1. Problem description

When uploading a file with a Chinese name, since it is submitted directly to the document folder when submitting it to the staging area, which contains files with Chinese file names, it is found that the Chinese name is displayed as multiple character encodings instead of Chinese. , then there will be a problem if you continue to git commit;
Insert image description here

2. Problem solving

Chinese can be displayed by setting git:
1. Enter the command in git bash terminal:

git config --global core.quotepath false

After setting, check the git status again as follows. It has become a Chinese file name;
Insert image description here

2. Right-click on the blank space in git bash and configure it through the menu settings:
.Right-click and select options -->Text
Locale. Change the option to zh_CN
Character and change the option to UTF-8.

Insert image description here

Subsequent submission

Note:
1. Because when I submitted the staging area, I submitted the entire document folder without specifying the Chinese path. So if I want to submit it to the local library, I actually directly git commit -m "Submit Instructions". Can the document be submitted directly to I don’t know if the local library is successful(Because I have already set up the Chinese display operation)
2. In the picture below, when I submitted the local library, the error was reported because the file name I specified was incomplete. I had to specify it in the document folder. If I specified the
correct path, I could submit it directly with the Chinese file name.
Insert image description here

Guess you like

Origin blog.csdn.net/weixin_42640280/article/details/127354163