by shigemk2

当面は技術的なことしか書かない

git statusの文字化け対策

git config --global core.quotepath false

ってやるといいんだけど、なんでこの設定にしないといけないんだっていうのが見つからなかったので。

The commands that output paths (e.g. ls-files, diff), when not given the -z option, will quote "unusual" characters in the pathname by enclosing the pathname in a double-quote pair and with backslashes the same way strings in C source code are quoted. If this variable is set to false, the bytes higher than 0x80 are not quoted but output as verbatim. Note that double quote, backslash and control characters are always quoted without -z regardless of the setting of this variable.

バイト数が0x80以上の文字列については、C言語で読める形にしてからダブルクオートで囲われるような設定がデフォルトになっており、core.quotepathをfalseにするとこの設定がなくなる。

っていうところでいうと、「文字化け」って言われているのも厳密に言うと文字化けではないと思う。

git/日本語ファイル名をgit statusなどで表示する方法 - TOBY SOFT wiki

ftp://www.kernel.org/pub/software/scm/git/docs/git-config.html