- 设置 Git 的字符编码为 UTF-8:
在 Git Bash 中执行以下命令:
git config --global core.quotepath false
git config --global gui.encoding utf-8
git config --global i18n.commit.encoding utf-8
git config --global i18n.logoutputencoding utf-8
这些命令将 Git 的字符编码设置为 UTF-8,这样中文就不会出现乱码了。
- 修改 Git Bash 的终端设置:
在 Git Bash 的窗口中,右键标题栏,选择“Options”(选项),然后在“Text”(文本)选项卡中设置“Locale”(区域设置)为“zh_CN”(中国大陆),并将“Character set”(字符集)设置为“UTF-8”。
点击“Apply”(应用)按钮保存设置,然后重启 Git Bash。
同时, 如果pychram 中的terminal 遇到问题, 可以参考。
https://www.cnblogs.com/pergrand/p/13212787.html。