# Git: `core.quotePath` and Non-ASCII Filenames `core.quotePath` defaults to `true`: "unusual" characters in file paths are quoted and escaped; for example: 1. In a Git repository, run `touch 0-漢-©-あ-a` (to create a test file whose filename contains non-ASCII characters.) 2. Run `git status` (and see that the non-ASCII characters are escaped): ```Text On branch main Untracked files: (use "git add
..." to include in what will be committed) "0-\346\274\242-\302\251-\343\201\202-a" nothing added to commit but untracked files present (use "git add" to track) ``` 3. Run `git -c core.quotepath=false status` (and see that non-ASCII characters are not escaped): ```Text On branch main Untracked files: (use "git add
..." to include in what will be committed) 0-漢-©-あ-a nothing added to commit but untracked files present (use "git add" to track) ``` # References [`core.quotePath`](https://git-scm.com/docs/git-config/2.20.0#Documentation/git-config.txt-corequotePath): > 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. `\t` for TAB, `\n` for LF, > `\\` for backslash) or bytes with values larger than 0x80 (e.g. octal > `\302\265` for "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 -z option. The default value is true. [`git -c
=
`](https://git-scm.com/docs/git/2.20.0#Documentation/git.txt--cltnamegtltvaluegt): > Pass a configuration parameter to the command. The value given will > override values from configuration files. The `
` is expected in > the same format as listed by `git config` (subkeys separated by dots).
Chat / Q&A
閒聊/問答