简体   繁体   中英

Git locale error on Lion OSX

Everything seems to work great, Git pulls and pushes; however -- it adds an annoying locale error. Any idea how to solve it?

konzepz:project (master  ⚡) ➤ git pull
bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)
Already up-to-date.

Thanks!

Modify your bashrc. Paste:

export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

Restart the session.

This seems to be a problem of GitHub. I have two remotes for one repository, one on GitHub (gh) and one on a server I maintain myself (dckd):

master± ⮀ git pull gh master
bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)
From github.com:jeroenh/OpenNSA
 * branch            master     -> FETCH_HEAD
Already up-to-date.

master± ⮀ git pull dckd master
From dckd.nl:git/opennsa
 * branch            master     -> FETCH_HEAD
Already up-to-date.

[edit]

I've been in touch with GitHub support, and they will fix it on their server. The fix would be to either support this locale on the GitHub server, or set the SSH server configuration to not accept LC_* environment variables.

To the best of my knowledge en_GB is indeed the correct descriptor for British English, but for some reason Lion does not seem happy with it (when previously it worked).

What does work however is to use en_UK. So:

export LC_CTYPE=en_UK.UTF-8
export LC_ALL=en_UK.UTF-8

appear to do the right thing.

I haven't yet found the list of all locales supported by Mac OS, but this works for me:

export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

As well as this:

export LC_CTYPE=en_CA.UTF-8
export LC_ALL=en_CA.UTF-8

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM