Solution to the Chinese garbled code in git status: 1. Check the current workspace status; 2. Configure "core.quotepath" as "false"; 3. Change the git bash client text character set to the environment variable Encoding settings remain consistent.
The operating environment of this article: Windows 7 system, Git version 2.30.0, Dell G3 computer.
What should I do if the git status is garbled in Chinese?
git status Chinese file names are garbled
When using git status to check the workspace status and git add
1. Reproduce the scenario
Add test.txt in the working directory and view the current workspace status
2. Solve the problem
Configure core.quotepath to false
$ git config --global core.quotepath false # 在使用git log出现乱码上面一个设置不能解决问题需要再做以下设置 git config --global gui.encoding utf-8 git config --global i18n.commit.encoding utf-8 git config --global i18n.logoutputencoding utf-8 export LESSCHARSET=utf-8 # 添加到环境变量
# If the problem cannot be solved through the above settings, or the Chinese git log is still garbled. Check whether the text character set of the git bash client is consistent with the above settings. If the inconsistency is changed to be consistent
Let’s check the workspace status
You can see that the Chinese name can be displayed normally.
Recommended learning: "Git Tutorial"
The above is the detailed content of What to do if git status is garbled in Chinese?. For more information, please follow other related articles on the PHP Chinese website!