转载自:http://blog.csdn.net/u013068377/article/details/52168434

git bash下中文乱码解决办法:

一.解决办法1:(直接上图)

1.在git bash下,右键 出现下图,选择options:

使用git 中文乱码解决办法

2.选择“Text”

使用git 中文乱码解决办法

3.将“Character set”设置为  UTF-8

使用git 中文乱码解决办法


二.解决办法2:(在上述办法1中,如果在git  bash中,右键没有菜单的情况下)

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

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

[plain] view plain copy
  1. [gui]  
  2.     encoding = utf-8  #代码库统一使用utf-8  
  3. [i18n]  
  4.     commitencoding = utf-8  #log编码  
  5. [svn]  
  6.     pathnameencoding = utf-8  #支持中文路径  

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

[plain] view plain copy
 
 使用git 中文乱码解决办法使用git 中文乱码解决办法
  1. alias ls='ls --show-control-chars --color=auto'  #ls能够正常显示中文  


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

[plain] view plain copy
 
 使用git 中文乱码解决办法使用git 中文乱码解决办法
  1. set output-meta on  #bash可以正常输入中文  
  2. set convert-meta off  


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

[plain] view plain copy
 
 使用git 中文乱码解决办法使用git 中文乱码解决办法
  1. export LESSHARESET=utf-8  

相关文章:

  • 2021-10-22
  • 2021-12-28
  • 2021-06-19
  • 2021-12-27
  • 2021-11-11
  • 2021-06-06
  • 2021-10-15
  • 2022-02-04
猜你喜欢
  • 2021-12-11
  • 2022-02-20
  • 2021-07-26
  • 2021-12-15
  • 2021-06-30
相关资源
相似解决方案