Windows下Git Bash乱码问题解决

Windows下Git Bash乱码问题解决

缘起

个人用的电脑是Mac OS,系统和终端编码都是UTF-8,但公司给配发的电脑是Windows,装上Git Bash在使用 git commit -m "中文"时会乱码

解决

  1. 确认有以下配置
shell 复制代码
# 输入
git config --global --list
# 展示
core.quotepath=false
gui.encoding=utf-8
i18n.commit.encoding=utf-8
i18n.logoutputencoding=utf-8
i18n.commitencoding=utf-8

没有的话就配置:

shell 复制代码
git config --global core.quotepath false
git config --global gui.encoding utf-8
git config --global i18n.commitencoding utf-8
git config --global i18n.logoutputencoding utf-8
  1. 本地配置也要设置
shell 复制代码
git config --local core.quotepath false
git config --local gui.encoding utf-8
git config --local i18n.commitencoding utf-8
git config --local i18n.logoutputencoding utf-8
  1. 页面配置
    Git bash上工具栏右键 ->Options -> Text -> encoding,然后选择utf-8
相关推荐
十五年专注C++开发3 小时前
TypePerf:Windows 命令行性能计数器工具(CPU利用率、内存利用率、GPU利用率等)
c++·windows·typeperf
Snooker_1464 小时前
TRAE、VSCode上进行git管理
ide·git·vscode
学不思则罔5 小时前
ParallelStream并发陷阱解析
java·开发语言·windows
zincsweet6 小时前
Git开发工具教程
git
yuyuyui6 小时前
Git实战覆盖98%日常开发场景
git
白小沫7 小时前
解决 TortoiseSVN 文件夹不显示图标的问题(Windows 10/11 通用)
windows·经验分享·笔记
2501_939998208 小时前
微软推送 Win11 2026 年 5 月累积更新(KB5089549)
windows
令狐少侠20118 小时前
workbuddy、openclaw能控制浏览器
windows·ai
AI砖家8 小时前
DeepSeek TUI 保姆级安装配置全指南 -Windows||macOS双平台全覆盖
服务器·前端·人工智能·windows·macos·ai编程·策略模式
谪星·阿凯8 小时前
Windows提权实战博客
windows·web安全·网络安全