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
相关推荐
郑泰科技15 分钟前
mstsc 频繁断开是由svchost 策略引起的吗?
windows·笔记·负载均衡
开开心心就好39 分钟前
OCR识别工具可加AI接口,快捷键截图翻译便捷
java·网络·windows·随机森林·电脑·excel·推荐算法
张二娃同学2 小时前
深度学习入门篇——Github的使用和项目的导入
人工智能·git·深度学习·开源·github
喂自己代言2 小时前
Windows 10 22H2 纯系统自带工具安全方案
windows·安全
SadSunset3 小时前
Git分支
git
Lewin.Lin5 小时前
git安装与gitee教程
git·gitee
天才程序YUAN6 小时前
Windows自动修改系统环境变量(PATH)中所有 D 盘路径的脚本
运维·windows
幺零九零零7 小时前
Windows + Docker + k6 + InfluxDB + Grafana
windows·docker·grafana
C_心欲无痕7 小时前
git - 版本回退的两种方式
git
s47 小时前
Python安装在C盘后如何移到D盘
c语言·windows·python