【问题标题】:git not displaying unicode file namesgit不显示unicode文件名
【发布时间】:2016-04-05 13:55:12
【问题描述】:

我在 Mac OS X 上使用 git 2.5.4。

我有包含é 的文件名,git 用转义符显示它。有没有办法让它使用 unicode 并显示字符?终端显然可以处理它。

> ls
Sél

> git status
Untracked files:
(use "git add <file>..." to include in what will be committed)
...
"S\303\251l"

我希望该文件显示为Sél,而不是S\303\251l

【问题讨论】:

    标签: git unicode


    【解决方案1】:

    先检查git config core.quotePath false 是否有帮助。

    git config --global core.quotePath false
    

    如果不是,如“Git and the Umlaut problem on Mac OS X”中所述,请尝试:

    git config --global core.precomposeunicode true
    

    来自git config man page

    core.precomposeUnicode
    

    此选项仅由 Git 的 Mac OS 实现使用。
    core.precomposeUnicode=true 时,Git 还原了 Mac OS 对文件名的 unicode 分解。

    【讨论】:

    • 谢谢!解决了我在处理以俄罗斯和立陶宛命名的文件名时长期存在的挫败感。
    • 虽然git config --global core.precomposeunicode true“仅用于”Mac,但它有助于解决我在 Windows 上使用 unicode 的问题
    猜你喜欢
    • 1970-01-01
    • 2013-01-11
    • 2011-05-20
    • 2019-09-24
    • 2020-12-09
    • 2012-08-02
    • 1970-01-01
    • 2012-08-03
    • 2018-01-10
    相关资源
    最近更新 更多