windows上Git bash 查看log乱码
设置 Git 支持 utf-8 编码
在命令行下输入以下命令:
|
|
在 etc\gitconfig 中添加
|
|
在etc\profile 中添加
|
|
说明:
- gui.encoding = utf-8 解决在 $ git gui 和 gitk 里中文乱码。如果发现代码中的注释显示乱码,可以设置项目根目录中.git/config文件添加
12[gui]encoding = utf- 8
- i18n.commitencoding = utf-8 设置 commit log 提交时使用 utf-8 编码,可避免服务器上乱码,同时与Unix上的提交保持一致!
- i18n.logoutputencoding = gbk 使得在 $ git log 时编码设置为 utf-8
-
export LESSCHARSET=utf-8
使得 $ git log 可以正常显示中文(配合i18n.logoutputencoding 的设置)
让 ls 命令可以显示中文名称
修改 etc\git-completion.bash 文件:
|
|
这样设置后,基本可以解决中文显示的问题。