How to handle Asian characters in file names in Git on OS X

后端 未结 1 1314
旧时难觅i
旧时难觅i 2020-12-07 22:57

I\'m on US-English OS X 10.6.4 and try to store files with Asian characters in its name in a Git repository.

OK, let\'s create such a file in a Git working tree

相关标签:
1条回答
  • 2020-12-07 23:32

    Git quotes any non-ascii character by default, not only asian ones. There's an option to disable this quoting behaviour.

    You can disable it using the following command:

    git config --global core.quotepath false
    

    Or, alternatively, by adding the following snippet to your git config file ($HOME/.gitconfig usually)

    [core]
        quotepath = false
    

    After this, git should show your filenames exactly as they are.

    As to your other problem, git not adding a file with asian characters, I can only guess that it has to do with the encoding that git uses is not the same as the encoding your terminal uses. I hope someone else can jump in and explain that bit.

    0 讨论(0)
提交回复
热议问题