How to change the language of my git?

The reason for this is that your command line language is set to German. So when you do:

echo $LANG

you will see:

de_DE.UTF-8

To change this, do:

echo "export LANG=en_US.UTF-8" >> ~/.bashrc

assuming your standard shell is bash.

Don't forget:

source ~/.bashrc

In my case, setting LANG or LC_ALL was not enough. I also had a LANGUAGE environment variable which was set to en_GB:en_US:de. Despite the ordering, which is presumably an order of preference, it resulted in a German language response from git and other commandline-programmes. When I changed it to en_GB:en_US, git and other programmes became English.


Sometimes changing the LANG environment variable alone is not good enough.

You may also need to add LC_ALL

export LC_ALL=en_US.UTF-8

According to The IEEE and The Open Group - Environment Variables.

It is because the environment variables starting by LC_* will be used first by your system before LANG:

The values of locale categories shall be determined by a precedence order; the first condition met below determines the value:

  1. If the LC_ALL environment variable is defined and is not null, the value of LC_ALL shall be used.

  2. If the LC_* environment variable (LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, LC_TIME) is defined and is not null, the value of the environment variable shall be used to initialize the category that corresponds to the environment variable.

  3. If the LANG environment variable is defined and is not null, the value of the LANG environment variable shall be used.

  4. If the LANG environment variable is not set or is set to the empty string, the implementation-defined default locale shall be used.

To change it permanently, you need to paste the code above into your favourite shell configuration file (probably ~/.bashrc or ~/.zshrc)

Then to apply the modification do:

$ source ~/.bashrc

or

$ source ~/.zshrc

Otherwise, just open a new terminal.


Probably you locale is german. You can see it by locale. Try to change it by: export LANG="en_US.UTF-8"