How does one change the language of the command line interface of Git?

前端 未结 8 2000
悲&欢浪女
悲&欢浪女 2020-12-07 13:27

I’d like to change the language of git (to English) in my Linux installation without changing the language for other programs and couldn’t find the settings. How to do it?

8条回答
  •  春和景丽
    2020-12-07 14:14

    As Bengt suggested : Add these lines to your ~/.bashrc or ~/.bash_profile to force git to display all messages in English: vim ~/.bashrc - for this profile (if you are user ubuntu and you edit this it will be only for this user); add this lines:

    # Set Git language to English
    #alias git='LANG=en_US git'
    alias git='LANG=en_GB git'
    #you can add also 
    LANG=en_GB
    

    and after you close the file you need to write in shell:

    source ~/.bashrc 
    

    to reload new settings or exit the terminal and connect again :)

提交回复
热议问题