linux下编译安装新版git(1.8.5.4)后,命令行下git输出全是中文,可以按以下操作将输出改回英文:
Add these lines to your .bashrc
or .bash_profile
to force git to display all messages in English:
# Set Git language to English #alias git='LANG=en_GB git' alias git='LANG=en_US.uft8 git'
The alias needs to override LC_ALL
on some systems, when the environment variable LC_ALL
is set, which has precedence over LANG
. See the UNIX Specification – Environment Variables for further explanation.
# Set Git language to English #alias git='LC_ALL=en_GB git' alias git='LC_ALL=en_US.uft8 git'
In case you added these lines to .bashrc
the alias will be defined when a new interactive shell gets started. In case you added it to .bash_profile
the alias will be applied when logging in.