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
相关推荐
comcoo30 分钟前
电脑自动干活不用值守!OpenClaw 本地部署完整实操流程
windows·开源·github·open claw部署·open claw部署包
蓝鸟19741 小时前
Windows Route 内外网双通原理+实战详解(彻底解决双网卡互斥断网)
windows·网络运维·电脑网络配置·路由冲突解决·route命令·内外网同时上网·windows路由 双网卡双通
2601_961845422 小时前
法考真题及答案解析|历年真题|资料已整理
linux·windows·ubuntu·macos·centos·gnu
呆萌的代Ma3 小时前
Git不强行推送,撤销最近几次的提交
git
coolwaterld4 小时前
windows下删文件,找出“到底是谁占用
windows
caimouse6 小时前
Reactos 第6章 进程间通信(续)
windows
Drone_xjw6 小时前
Kylin 系统下使用 Shell 脚本定期清理历史文件
bash·kylin
透明的玻璃杯6 小时前
git应用
git
触底反弹6 小时前
拷个 .exe 到新电脑就跑不起来?你缺的不是文件,是对链接的理解
c++·windows·操作系统
W优化大师6 小时前
Windows 更新待处理弹窗一直不消失怎么解决,C 盘空间和后台任务该如何排查
windows·系统优化·磁盘清理·windows11·c盘·系统更新