Git Bash Chinese garbled characters in Windows,

Source: Internet
Author: User

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

  1. [Gui]
  2. Encoding = UTF-8 # use UTF-8 in the code library
  3. [I18n]
  4. 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.
  5. [Svn]
  6. Pathnameencoding = GB2312 # Chinese path supported

 

2. Edit git-completion.bash file: $ vi git-completion.bash

Add at the bottom

  1. 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

  1. Set output-meta on # enter Chinese characters normally in bash
  2. Set convert-meta off

 

4. Edit the profile file: $ vi profile

Add at the bottom

  1. Export LESSHARSET = UTF-8

 

5. recompile the configuration file to make the file take effect.

$ Source git-completion.bash

$ Source inputrc

$ Source profile

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.