时间:2020年8月17日15:09:12
问题:Git log乱码问题
hp@a-PC MINGW64 /d/p2p_web (master)
$ git config --global core.quotepath false
hp@a-PC MINGW64 /d/p2p_web (master)
$ git config --global gui.encoding utf-8
hp@a-PC MINGW64 /d/p2p_web (master)
$ git config --global i18n.commit.encoding utf-8
hp@a-PC MINGW64 /d/p2p_web (master)
$ git config --global i18n.logoutputencoding utf-8
hp@a-PC MINGW64 /d/p2p_web (master)
$ export LESSCHARSET=utf-8

解决办法如下:
在Linux及托管网站上默认的编码都是utf-8,而Windows系统默认编码不是采用utf-8,所以Git 客户端在Windows下总是会有一些问题。一个解决方案就是通过设置git编码为utf-8。
设置 Git 支持 utf-8 编码
在命令行下输入以下命令:
依次执行以下命令:

以上命令等效于:
在 etc\gitconfig 中添加如下内容:

该博客解决了在Windows下使用Git时遇到的log中文乱码问题。通过设置Git支持utf-8编码,包括在命令行配置以及修改git-completion.bash文件,确保gui.encoding、commitencoding和logoutputencoding正确设置,以实现中文正常显示。
最低0.47元/天 解锁文章
466

被折叠的 条评论
为什么被折叠?



