场景

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

> 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"

解决办法

> git config --global core.quotepath false