zsh git pull 'perl warnings'

在zsh中用git拉代码,遇到了下面的问题,尝试解决了下。

问题:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
From 39.107.54.6:newpj
* branch            f_panda_hurong -> FETCH_HEAD
Already up to date.

在 stackoverflow上找到了如下的解决方案,因为我的系统是mac ,在linux 上和之前从来没有遇到过这个问题,貌似是locale 的问题,我man locale 了一下,也没太看明白,反正照着设置了一下,问题解决了,那个警告提示没有了。原帖子如下的回答如下:

Here is how to solve it on Mac OS Lion (10.7) or Cygwin (Windows 10): Add the following lines to your bashrc or bash_profile on the host machine:

Setting for the new UTF-8 terminal support in Lion

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

Setting for the new UTF-8 terminal support in Lion

If you are using zsh, edit zshrc, then source .zshrc

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

还有一种可能是,系统的语言设置有问题,系统的语言最好改成 en-us的,然后重新登录检查是否生效.大家代码愉快!
《zsh git pull 'perl warnings'》

点赞

Leave a Reply

Your email address will not be published.