git status中文乱码解决
目录
[TOC]
报错
$ git status
On branch main
Your branch is ahead of 'origin/main' by 2 commits.
(use "git push" to publish your local commits)
Untracked files:
(use "git add <file>..." to include in what will be committed)
"\346\265\213\350\257\225\346\226\207\344\273\266.txt"
nothing added to commit but untracked files present (use "git add" to track)
解决方法
手动设置编码方式为utf-8并关闭文件名转义
git config --global i18n.commitEncoding utf-8
git config --global core.quotepath false
然后再看就没问题了
$ git status
On branch main
Your branch is ahead of 'origin/main' by 2 commits.
(use "git push" to publish your local commits)
Untracked files:
(use "git add <file>..." to include in what will be committed)
测试文件.txt
nothing added to commit but untracked files present (use "git add" to track)