解决windows下git bash 中文乱码问题

    xiaoxiao2021-03-25  147

    进入git安装目录,通常是C:\Program Files\Git\

    1 编辑或者创建etc\gitconfig文件,在文件末尾增加以下内容:

    [gui] encoding = utf-8 #代码库统一使用utf-8 [i18n] commitencoding = utf-8 #log编码 [svn] pathnameencoding = utf-8 #支持中文路径

    2 编辑etc\git-completion.bash文件,在文件末尾增加以下内容:

    alias ls='ls --show-control-chars --color=auto' #ls能够正常显示中文

    3 编辑etc\inputrc文件,修改output-meta和convert-meta属性值:

    set output-meta on #bash可以正常输入中文 set convert-meta off

    4 编辑profile文件,在文件末尾添加如下内容:

    export LESSHARESET=utf-8

    5 在git bash 中右键找到text选项 设置编码为utf -8,如图:

    转载请注明原文地址: https://ju.6miu.com/read-6019.html

    最新回复(0)