본문 바로가기

Develop/git-github

git status 한글 깨짐

git status를 할 때, 한글이름을 가지는 파일일 경우에 /200/300/385 이런식으로 파일명이 깨지는 경우가 있다. (mac 터미널)

git config --global core.quotepath false

위 설정으로 바꾸면 올바르게 한글이름 파일을 git status로 상태확인이 가능해진다.

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. \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.

output path에 대한 커맨드는 unusual인 패스 이름을 조정한다. ( " 가 들어가 있거나, escaping 이 들어가 있는 경우 )
이때 한글 인코딩이 UTF-8에 들어가 0x80 보다 큰 바이트를 가진 escape 문자 처리가 되어 "unusual"인 케이스로 포함이 된다.

그래서 이 변수를 false로 설정하면

0x80보다 높은 바이트는 더 이상 "unusual" 인 것으로 간주되지 않는다.
"unusual"로 간주되는 큰 따옴표, 백 슬래시 및 제어 문자는 이 변수의 설정에 관계없이 항상 이스케이프 되며,
단순한 공백 문자는 "unusual"로 간주되지 않는다.

참고 : https://git-scm.com/docs/git-config#Documentation/git-config.txt-corequotePath

 

Git - git-config Documentation

When using the deprecated [section.subsection] syntax, changing a value will result in adding a multi-line key instead of a change, if the subsection is given with at least one uppercase character. For example when the config looks like [section.subsection

git-scm.com

 

'Develop > git-github' 카테고리의 다른 글

git 종종 사용하지만 까먹는 명령어들  (1) 2021.11.12
git & github cooperation - DSC Ewha 세션  (0) 2019.10.15
git & github basic - DSC Ewha 세션  (0) 2019.10.15
git-flow 전략  (1) 2019.08.02