Contents
  1. 1. git log中文乱码
  2. 2. git status中文乱码

ubuntu18.04出来后尝鲜,把原来的16.04格了重装了,但在使用git的时候出现了一些问题。记录备查。

git log中文乱码

使用git log查看日志的时候,中文会被显示成为数字,应该是UTF-8编码,使用以下命令解决:

1
2
3
git config --global i18n.commitencoding utf-8
git config --global i18n.logoutputencoding utf-8
export LESSCHARSET=utf-8

git status中文乱码

使用前面的命令解决了查看日志乱码的问题,但是在使用git status的时候,依然出现乱码,使用以下命令解决:

1
git config --global core.quotepath false

Contents
  1. 1. git log中文乱码
  2. 2. git status中文乱码