Отображение кириллических имён файлов в git status
Добавляю в кагалог файл с названием на кириллице (или просто не-ASCII), и получаю:
$ git status
On branch main
Your branch is up to date with 'origin/main'.
Untracked files:
(use "git add ..." to include in what will be committed)
"\320\260\320\261\320\262\320\263\320\264.txt"
Как сделать нормальное отображение?
Ответы (1 шт):
Используйте опцию core.quotePath:
- core.quotePath
Commands that output paths (e.g.
ls-files,diff), will quote "unusual" characters in the pathname by enclosing the pathname in double-quotes and escaping those characters with backslashes in the same way C escapes control characters (e.g.\tfor TAB,\nfor LF,\\for backslash) or bytes with values larger than 0x80 (e.g. octal\302\265for "micro" in UTF-8). If this variable is set to false, bytes higher than 0x80 are not considered "unusual" any more. Double-quotes, backslash and control characters are always escaped regardless of the setting of this variable. A simple space character is not considered "unusual". Many commands can output pathnames completely verbatim using the-zoption. The default value is true.
Соответственно, эту опцию надо установить в false:
$ git config --global core.quotePath false
$ git status
On branch main
Your branch is up to date with 'origin/main'.
Untracked files:
(use "git add ..." to include in what will be committed)
абвгд.txt