Git 在Mac下的中文乱码问题


最近重新安装电脑,发现电脑中的GIt 命令行一直显示为UTF-8编码没有正常显示中文。

其实方案很简单,把~/.gitconfig里修改好,source下就行了。看官可以在任何linux下这么搞。

[core]
        autocrlf = input
        excludesfile = /Users/lonecloud/.gitignore_global
        quotepath = false
[difftool "sourcetree"]
        cmd = opendiff \"$LOCAL\" \"$REMOTE\"
        path =
[mergetool "sourcetree"]
        cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
        trustExitCode = true
[gui]
        encoding = utf-8
[i18n "commit"]
        encoding = utf-8
[i18n]
        logoutputencoding = utf-8
        commitencoding = utf-8

配置可见Github

相关