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
相关推荐
空空kkk24 分钟前
Git版本控制——diff命令
git
克喵的水银蛇25 分钟前
Flutter 通用底部导航栏:BottomNavWidget 一键实现样式统一与灵活切换
windows·flutter
克喵的水银蛇42 分钟前
Flutter 通用轮播图组件:BannerSlider 一键实现自动轮播与灵活定制
windows·microsoft
小王不爱笑1321 小时前
Git简单的文件提交操作
git
技术小甜甜2 小时前
【系统实战排坑】电脑重启后总是直接进入 Windows,按键无效进不了 BIOS?最全解决方案在这里!
windows·电脑·蓝屏
阿富软件园2 小时前
文档搜索利器——“搜索文本”全能版 支持多格式 加 内容搜索
windows·电脑·开源软件
取个名字太难了a2 小时前
任务段提权实验
windows
封奚泽优2 小时前
Deep-Live-Cam(调试和求助)
git·python·ffmpeg·pip·cuda
2301_793069823 小时前
Linux Ubuntu/Windows 双系统 分区挂载指南
linux·windows·ubuntu
道路与代码之旅3 小时前
Windows 10 中以 WSL 驱 Ubuntu 记
linux·windows·ubuntu