[Git] windows git supports environment configuration in Chinese

Source: Internet
Author: User
Document directory
  • 1. Question about Chinese Input in gitbash
  • 2. Question about the Chinese output of the page splitter.
  • 3 LS command to display Chinese file name garbled

# Configuration of git Chinese support environment under Win
# Reference: git authoritative guide

After installing msysgit in Windows, you can't wait to open gitbash.
I typed a Chinese character. Why is there nothing?
Figure 1

Next, let's take a look at the method configuration in the GIT authoritative guide. Here, my git installation directory is D: \ devsofts \ git. The following operations are not particularly described in this directory.
You can use the text editor to modify the configuration file.

1. Question about Chinese Input in gitbash

The default msysgit shell cannot input Chinese characters.
The value to be modified is/etc/inputrc.
Original content:
# Disable/enable 8bit Input
Set meta-flag on
Set input-meta on
Set output-meta off
Set convert-meta on
To:
# Disable/enable 8bit Input
Set meta-flag on
Set input-meta on
Set output-meta on # first place
Set convert-meta off # second place
Save the modification, open gitbash again, and check the effect.
$ Hello

Figure 2

2. Question about the Chinese output of the page splitter.

When we perform the operation, there will still be garbled code $ echo ya'an | less

Figure 3
The modified file is also in the ECT directory,/etc/porfile
Add the following environment settings at the end of the file:
Declare-x lesscharset = UTF-8 # remember that there is no space after the = Sign
Incorrect syntax
Declare-x lesscharset = UTF-8

Figure 4
Show normal

3 LS command to display Chinese file name garbled

If the current directory contains Chinese characters, the file name will contain garbled characters when using ls to list objects.

Figure 5 shows the question mark

The simplest solution is to add a string of parameters after ls.

Figure 6
For the sake of convenience, we also configure it to/etc/porfile, and add it at the end.
The configuration is as follows:
Alias ls = "ls -- show-control-chars"

Figure 7. This is normal.

For other encoding problems, such as comment and commit, if you find a good way to record the file name.

Related Article

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.