The solution of Chinese garbled Code in git status
This article is to share with you about the solutions to Chinese garbled in git status. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Git status Chinese garbled solutions: 1, view the current workspace status; 2, configure "core.quotepath" to "false"; 3, keep the git bash client text character set consistent with the encoding settings in the environment variables.
This article operating environment: Windows7 system, Git2.30.0 version, Dell G3 computer.
Git status Chinese file name is garbled
When you use git status to view the workspace status and git add to add files, you will sometimes find that files named in Chinese are displayed as a string of numbers. For example,\ 346\ 265\ 213\ 350\ 257\ 225.txt, this situation is actually caused by garbled codes and can be solved by configuration.
1. Scene reproduction
Add test .txt to the working directory to view the current workspace status
two。 Solve the problem
Configure core.quotepath to false
$git config-- global core.quotepath false# causes garbled when using git log. The above setting does not solve the problem. You need to set git config-- global gui.encoding utf-8git config-- global i18n.commit.encoding utf-8git config-- global i18n.logoutputencoding utf-8export LESSCHARSET=utf-8 # to add to the environment variable.
# if the problem cannot be solved by the above settings, or the git log Chinese is still garbled. Check to see if the git bash client text character set is consistent with the above settings. If it is inconsistent, change it to be consistent.
Let's check the status of the workspace again.
You can see that the Chinese name has been displayed normally.
Thank you for reading! This is the end of this article on "the solution to Chinese garbled code in git status". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!