1、现象
git目录下是这样的:
git status后是这样的:
经过比对,对汉字采取了编码
2、解决方案如下:
配置core.quotepath为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 # 添加到环境变量
通过以上设置如还不能解决问题,或是git log中文仍然乱码。查看下git bash客户端文本字符集是否和以上设置保持一致。如果不一致修改为一致
我们再来查看工作区状态
可以看到中文名已经能正常显示了。