git bash 支持中文

 
1. 编辑etc\gitconfig文件,在文件末尾增加以下内容:
[gui]  

    encoding = utf-8  #代码库统一使用utf-8  

    pathnameencoding = utf-8  #支持中文路径  

 

gitconfig 文件若没有找到,需要执行 :
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com

windows在当前用户目录下去找gitconfig文件

进入git安装目录,通常是C:\Program Files\Git\
 
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

 

posted @ 2017-05-24 15:32  潇水鱼米  阅读(768)  评论(0编辑  收藏  举报