git status中文显示乱码

场景

最近用了新的电脑,安装了git,但是运行命令git status的时候却出现了中文乱码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
> 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 checkout -- <file>..." to discard changes in working directory)

deleted: "009\346\225\260\346\215\256\347\256\241\347\220\206/\346\225\260\346\215\256\350\264\250\351\207\217\347\256\241\347\220\206/005-\347\247\221\347\240\224\347\256\241\347\220\206\347\263\273\347\273\237/\347\247\221\347\240\224 \345\211.xlsx"

Untracked files:
(use "git add <file>..." to include in what will be committed)

"009\346\225\260\346\215\256\347\256\241\347\220\206/\346\225\260\346\215\256\350\264\250\351\207\217\347\256\241\347\220\206/005-\347\247\221\347\240\224\347\256\241\347\220\206\347\263\273\347\273\237/\347\247\221\347\240\224_\351\207\215\346\226\260\345.xlsx"

解决办法

1
> git config --global core.quotepath false
SOCKSTACK wechat
关注内容更精彩