Git Bash Chinese garbled characters in Windows,
Open Git Bash
Go to the directory: $ cd/etc
1. Edit the gitconfig file: $ vi gitconfig
Add content to the file
- [Gui]
- Encoding = UTF-8 # use UTF-8 in the code library
- [I18n]
- Commitencoding = GB2312 # log encoding. The default value is gb2312 In the window. It will not be garbled after the declaration is sent to the server.
- [Svn]
- Pathnameencoding = GB2312 # Chinese path supported
2. Edit git-completion.bash file: $ vi git-completion.bash
Add at the bottom
- Alias ls = 'ls -- show-control-chars -- color = auto' # ls can display Chinese normally
3. Edit the inputrc file: $ vi inputrc
Modify output-meta and convert-meta attribute values
- Set output-meta on # enter Chinese characters normally in bash
- Set convert-meta off
4. Edit the profile file: $ vi profile
Add at the bottom
- Export LESSHARSET = UTF-8
5. recompile the configuration file to make the file take effect.
$ Source git-completion.bash
$ Source inputrc
$ Source profile