環境:windows10、Git-2.42.0.2-64-bit.exe
1. 問題描述
客戶端安裝后,默認是不支持中文顯示的,中文名的文件顯示亂碼,提交時打的標簽內容也不支持中文顯示。
2. 解決
新建Git全局配置文件,文件名為.gitconfig,內容如下:
[user]name = nnnnnnnnemail = mmmmmmmm@qq.coom
[core]autocrlf = falsequotepath = false
[svn]pathnameencoding = utf-8 ?# 支持中文路徑
[i18n]commitEncoding = utf-8logOutputEncoding = utf-8
[gui]encoding = utf-8
[credential "https://gitcode.com"]provider = generic
[credential "https://gitee.com"]provider = generic
注:name 和email 要寫成用戶實際的信息。將該文件拷貝到C:\Users\xxxxx
xxxxx:是計算機名
如下圖
3. 測試
中文顯示正常: