解决windows git乱码问题

在windows中打开git bash

git config --global i18n.commitencoding utf-8       设置提交日志使用utf-8

git config --global i18n.logoutputencoding utf-8    设置输出日志时使用utf-8

export LESSCHARSET=utf-8                               设置LESS字符集为utf-8

输入这三个命令之后,在git bash中中文乱码问题基本解决。

在powershell中的中文乱码问题解决方法

LESSCHARSET=utf-8                                         设置环境变量,将变量“LESSCHARSET”的值设置为utf-8

git config --global core.quotepath false                解决中文路径乱码问题

使用gitk或者git gui界面,查看更改前后的不同时也会有乱码。

git config --global gui.encoding utf-8                    解决图形界面乱码问题

原文地址:https://www.cnblogs.com/swyy/p/11213576.html