开发者

Git locale error on Lion OSX

开发者 https://www.devze.com 2023-03-22 12:17 出处:网络
Everything seems to w开发者_高级运维ork great, Git pulls and pushes; however -- it adds an annoying locale error. Any idea how to solve it?

Everything seems to w开发者_高级运维ork 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
0

精彩评论

暂无评论...
验证码 换一张
取 消