相关疑难解决方法(0)

如何在OS X上的Git中处理文件名中的亚洲字符

我使用的是美国英语OS X 10.6.4,并尝试在Git存储库中存储名称中包含亚洲字符的文件.

好的,让我们在Git工作树中创建这样一个文件:

$ touch ????????????????.txt
Run Code Online (Sandbox Code Playgroud)

Git将它显示为八进制转义的UTF-8格式:

$ git version
git version 1.7.3.1
$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   "\343\201\250\343\202\231\343\201\206\343\202\202\343\201\202\343\202\212\343\201\213\343\202\231\343\201\250\343\201\206\343\203\237\343\202\271\343\202\277\343\203\274\343\203\255\343\203\233\343\202\231\343\203\203\343\203\210.txt"
nothing added to commit but untracked files present (use "git add" to track)
Run Code Online (Sandbox Code Playgroud)

不幸的是,我无法将其添加到Git存储库:

$ git add ????????????????.txt
$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
#   (use "git …
Run Code Online (Sandbox Code Playgroud)

git unicode macos non-ascii-characters

39
推荐指数
1
解决办法
5589
查看次数

标签 统计

git ×1

macos ×1

non-ascii-characters ×1

unicode ×1