git 中文显示乱码处理


问题描述

查看日志列表

git log –color –graph –pretty=format:’%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset’ –abbrev-commit

* 556c3c721a - <E6><B3><A8><E9><87><8A> (23 hours ago) <c_w_c>
* 3bb71d0263 - <E8><B5><B7><E8><B5><94><E9><A2><9D> (25 hours ago) <c_w_c>
* bb2b2e4f56 - tp (25 hours ago) <c_w_c>
* 8ff3e02fd7 - <E8><B5><B7><E8><B5><94> (25 hours ago) <c_w_c>
* 784aec46c3 - <E8><AF><AD><E5><8F><A5> (25 hours ago) <c_w_c>
...

解决方法

.zshrc 文件中添加如下配置: vim ~/.zshrc

export LANG="zh_CN.UTF-8"
export LESSCHARSET=utf-8

参考文档


Author: Itaken
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source Itaken !
  TOC目录