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

前端 未结 8 1991
悲&欢浪女
悲&欢浪女 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:27

    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
    

提交回复
热议问题