git安装在公司中文windows10环境下,但是遇到不能显示中文字符,总是显示unicode符号,例如:

$ git status

On branch master

Your branch is up to date with 'origin/master'.

Changes not staged for commit:

  (use "git add <file>..." to update what will be committed)

  (use "git restore <file>..." to discard changes in working directory)

        modified:   "\351\200\232\347\224\250\350\204\232\346\234\254/General.c"

        modified:   "\351\200\232\347\224\250\350\204\232\346\234\254/resource.cpp"

对这些文件执行正常的git diff/git add,git总报告失败,不能精确选中它们。

需要执行一下如下命令调整git bash工作在UTF-8环境下,则系统恢复正常显示文件名中的中文和进行相应的git操作了。

git config --global core.quotepath false

git config --global gui.encoding utf-8

git config --global i18n.commit.encoding utf-8

git config --global i18n.logoutputencoding utf-8

export LANG=en_US.UTF-8

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐