Git 是在linux下开发的,而 Linux 的编码方式是基于 UTF-8 的,所以移植到 Windows 之后难免会存在编码冲突,导致乱码。
1.在Git Gui界面查看修改的文件时乱码的解决方案:
1.1 右键-Encoding - 选择编码方式Unicode(UTF-8)即可,如下图:

1.2 在Git Gui界面选择Edit-Options(对应中文编辑-选项),"默认文本内容编码方式"选择"Unicode(UTF-8)"即可


1.3 打开Git Bash命令行窗口输入以下命令进行全局修改编码方式:
git config --global gui.encoding utf-8
网友评论