자바스크립트를 활성화 해주세요

d003 git status 했을 때, 한글 파일명을 온전히 표시하는 방법

 ·  ☕ 2 min read

git push 할 때, 커밋메시지를 한글이나 일본어로 작성하면, 유니코드의 코드번호로 표시되어져서 무슨 내용인지 알아먹을 수가 없는 경우가 많습니다. 그래서 예전부터 커밋메시지를 영어로 쓰는 것을 장려해 왔었는데, hugo블로그를 쓰고 부터는 파일명이 타이틀이 되는 시스템이어서 한글 파일명을 사용해야만 했습니다.

물론 하나하나 영어로 바꿔가며 써도 됩니다만, 그러기에는 글의 내용에 집중해서 작성할 수가 없었기 때문에 그냥 한글 파일명을 사용해 왔었는데, git state 등에서 예쁘게 보이지 않는 이 문제는 좀 골치거리였습니다.

그런데, 이런 문제를 git은 이미 해결해 두었습니다.

core.quotePath

git config --global core.quotePath false

git의 core.quotePath 에 대한 설명은 여기에서 찾아 볼 수 있습니다.

실제 예

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
PS C:\Users\Administrator\blog> git status

On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        deleted:    archetypes/default copy.md
        deleted:    "content/hugo/001_hugo \354\204\244\354\271\230\355\225\230\352\270\260.md"
        deleted:    "content/hugo/004_hugo post\353\247\214\353\223\244 \353\225\214, \354\235\264\353\246\204\354\240\225\353\240\254\355\225\264\354\204\234 \353\263\264\353\212\224 \355\214\201.md"
        modified:   "content/hugo/006_post\353\247\214\353\223\244 \353\225\214 draft false \355\225\230\352\270\260.md"
        modified:   "content/hugo/011_Hugo Server\353\252\205\353\240\271\354\234\274\353\241\234 \353\240\214\353\215\224\353\247\201\353\220\234 \355\216\230\354\235\264\354\247\200\353\212\224 \354\226\264\353\224\224\354\227\220 \354\236\210\353\202\230\354\232\224.md"
        modified:   "content/hugo/016_hugo \353\270\224\353\241\234\352\267\270 \354\227\205\353\241\234\353\223\234 \355\225\230\352\270\260\354\234\204\355\225\264 \353\271\214\353\223\234\355\225\230\353\240\244\353\251\264 \354\226\264\353\226\273\352\262\214 \355\225\264\354\225\274\355\225\230\353\202\230\354\232\224.md"
        modified:   "content/hugo/dashboard\342\255\220.md"

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        archetypes/default origin.md
        content/devnote/
        "content/hugo/001_hugo \354\204\244\354\271\230\355\225\230\352\270\260, \354\226\264\353\226\273\352\262\214 \355\225\230\353\251\264 \354\240\234\354\235\274 \354\213\254\355\224\214\355\225\234\352\260\200\354\232\224.md"
        "content/hugo/004_Hugo Post\353\247\214\353\223\244 \353\225\214, \355\214\214\354\235\274\354\235\204 \354\213\234\352\260\204\354\210\234\354\234\274\353\241\234 \354\240\225\353\240\254\355\225\264\354\204\234 \353\263\264\353\212\224 \355\214\201.md"
        "content/hugo/028_hugo \355\217\254\354\212\244\355\212\270 \354\236\221\354\204\261\354\235\204 \354\234\204\355\225\234 \354\236\205\353\240\245 \354\204\244\354\240\225 \354\265\234\354\240\201\355\231\224.md"
        "content/hugo/029_hugo \355\217\254\354\212\244\355\212\270 \354\236\221\354\204\261\354\235\204 \354\234\204\355\225\234 vscode \354\204\244\354\240\225 \354\265\234\354\240\201\355\231\224.md"
        "content/hugo/030_\353\202\264 hugo \353\270\224\353\241\234\352\267\270 \354\226\264\354\240\234 \354\230\244\353\212\230 \353\252\207 \353\252\205 \354\240\221\354\206\215\355\226\210\353\202\230\354\232\224.md"
        "content/hugo/031_hugo \354\212\244\355\201\254\353\246\275\355\212\270 \354\213\244\355\226\211\354\235\204 \354\234\204\355\225\234 powershell \354\204\244\354\240\225 \354\265\234\354\240\201\355\231\224.md"
        content/powershell/
        content/vscode/

no changes added to commit (use "git add" and/or "git commit -a")
PS C:\Users\Administrator\blog> git config --global core.quotePath false

PS C:\Users\Administrator\blog> git status

On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        deleted:    archetypes/default copy.md
        deleted:    content/hugo/001_hugo 설치하기.md
        deleted:    content/hugo/004_hugo post만들 , 이름정렬해서 보는 .md
        modified:   content/hugo/006_post만들  draft false 하기.md
        modified:   content/hugo/011_Hugo Server명령으로 렌더링된 페이지는 어디에 있나요.md
        modified:   content/hugo/016_hugo 블로그 업로드 하기위해 빌드하려면 어떻게 해야하나요.md
        modified:   content/hugo/dashboard.md

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        archetypes/default origin.md
        content/devnote/
        content/hugo/001_hugo 설치하기, 어떻게 하면 제일 심플한가요.md
        content/hugo/004_Hugo Post만들 , 파일을 시간순으로 정렬해서 보는 .md
        content/hugo/028_hugo 포스트 작성을 위한 입력 설정 최적화.md
        content/hugo/029_hugo 포스트 작성을 위한 vscode 설정 최적화.md
        content/hugo/030_내 hugo 블로그 어제 오늘   접속했나요.md
        content/hugo/031_hugo 스크립트 실행을 위한 powershell 설정 최적화.md
        content/powershell/
        content/vscode/

no changes added to commit (use "git add" and/or "git commit -a")
PS C:\Users\Administrator\blog>

이 설정은 독일어의 움라우트 “Ü” 와 같은 문자는 물론, 에모지와 같은 문자들도 잘 보이게 해줍니다.

기타

git 의 출력 인코딩을 강제하는 다른 방법은?

$env:LC_ALL='C.UTF-8'

git log 명령으로 나온 Text를 변수로 담을 때, 한글이 깨진다면?

[System.Console]::OutputEncoding = [System.Text.Encoding]::UTF8

레퍼런스

공유하기

tkim
글쓴이
tkim
Software Engineer