How does one change the language of the command line interface of Git?
Adding this line solved the problem for me: Update: it seems like more components require a Locale as well now.
$ more ~/.bash_profile
export LANG=en_US (obsolete)
export LANG="en_US.UTF-8" (Updated)
If you just want to have one command in english instead you can just write LC_ALL=C
before the command, for example:
LC_ALL=C git status
will result in
# On branch master
nothing to commit, working directory clean
The locale as used in C
is English and always available without installing additional language packs
(see https://askubuntu.com/a/142814/34298)
To change it for the whole current bash session just enter
LANG=C
To change it for example to german enter
LANG=de_DE.UTF-8
Add these lines to your ~/.bashrc
, ~/.bash_profile
or ~/.zprofile
to force git to display all messages in English:
# Set Git language to English
#alias git='LANG=en_US git'
alias git='LANG=en_GB 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_US git'
alias git='LC_ALL=en_GB 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.