为什么 git 将 unicode 显示为二进制?
why does git show unicode as binary?
为什么 git status
和相关工具将文件名中的 unicode 视为二进制文件?
[991]anarcat@marcos:test$ git init foo
Dépôt Git vide initialisé dans /home/anarcat/test/foo/.git/
[992]anarcat@marcos:test$ cd foo
[993]anarcat@marcos:foo$ touch hé
[994]anarcat@marcos:foo$ git add hé
[996]anarcat@marcos:foo$ git status --porcelain
A "h31"
我预计这是:
A hé
git 在文件的 content 中很好地处理重音符号和 unicode,为什么文件名很特殊?
默认情况下 git 以带引号的八进制表示法打印非 ASCII 文件名。你可以禁用这个
git config --global core.quotepath off
为什么 git status
和相关工具将文件名中的 unicode 视为二进制文件?
[991]anarcat@marcos:test$ git init foo
Dépôt Git vide initialisé dans /home/anarcat/test/foo/.git/
[992]anarcat@marcos:test$ cd foo
[993]anarcat@marcos:foo$ touch hé
[994]anarcat@marcos:foo$ git add hé
[996]anarcat@marcos:foo$ git status --porcelain
A "h31"
我预计这是:
A hé
git 在文件的 content 中很好地处理重音符号和 unicode,为什么文件名很特殊?
默认情况下 git 以带引号的八进制表示法打印非 ASCII 文件名。你可以禁用这个
git config --global core.quotepath off