Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The solution of Chinese garbled Code in git status

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report