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

posted @ 2021-11-29 19:04  lonecloud  阅读(366)  评论(0编辑  收藏  举报
我的博客即将同步至 OSCHINA 社区,这是我的 OSCHINA ID:lonecloud,邀请大家一同入驻:https://www.oschina.net/sharing-plan/apply