【注意】最后更新于 May 22, 2019,文中内容可能已过时,请谨慎使用。
背景
git 的中文乱码问题一直困扰着我,当然新本的git客户端(2.15.0)安装完后,提交日志什么的基本没有什么乱码问题。只是在显示中文路径名的时候会有问题。我本机的表现为显示一串数字。
解决办法的
- 参考git乱码解决方案汇总,运行了命令
git config --global core.quotepath false
,在配置文件中出现
1
2
|
[core]
quotepath = false
|
git status
中文路径就没有乱码问题了
然后就没有然后了,不知道是不是之前折腾,电脑上已经有了状态记录。也可能是之前折腾的东西导致本来这么简单的东西显示不出来了。
我这里帖一下我目前的配置文件,网络上很多博文上说的 inputrc之类的没有做任何修改
1
2
3
4
5
6
7
8
9
10
11
12
13
|
[core]
quotepath = false
[user]
email = xxxx@xx.com
name = jeffrey
[alias]
st = status
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
co = checkout
br = branch
ci = commit
unstage = reset HEAD --
last = log -1 HEAD
|
下面是我第一次折腾通的配置文件:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
[core]
quotepath = false
[user]
email = xxxx@xx.com
name = jeffrey
[alias]
st = status
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
co = checkout
br = branch
ci = commit
unstage = reset HEAD --
last = log -1 HEAD
[i18n]
commitencoding = utf-8
logoutputencoding = utf-8
[svn]
pathnameencoding = GB2312
|