Article turned from: http://ideabean.iteye.com/blog/2007367
Open git Bash
Go to directory: $ cd/etc
1. Edit Gitconfig File: $ VI gitconfig
Add content to the file
XML code
- [GUI]
- encoding = Utf-8 #代码库统一使用utf-8
- [i18n]
- commitencoding = GB2312 #log编码, window under the default gb2312, the declaration sent to the server will not garbled
- [SVN]
- pathnameencoding = GB2312 #支持中文路径
2. Edit Git-completion.bash File: $ VI Git-completion.bash
Add at the bottom
XML code
- Alias ls=' ls--show-control-chars--color=auto ' #ls能够正常显示中文
3. Edit INPUTRC File: $ VI inputrc
modifying Output-meta and Convert-meta property values
XML code
- Set Output-meta on #bash中可以正常输入中文
- Set Convert-meta off
4. Edit Profile: $ VI Profiles
Add at the bottom
XML code
- Export lessharset=utf-8
5. Recompile the configuration file for the file to take effect
$ source Git-completion.bash
$ source Inputrc
$ source Profile