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
相关推荐
阿蒙Amon2 分钟前
C#每日面试题-索引器和迭代器的区别
开发语言·windows·c#
逍遥德31 分钟前
Java Stream Collectors 用法
java·windows·python
petunsecn36 分钟前
多 GitHub 账号与多平台 Git 使用(附加场景:就想用指定账号clone)
git·github
鸠摩智首席音效师1 小时前
如何创建带参数的 Bash 别名 ?
linux·bash
yuanmenghao1 小时前
Git submodule 与 git-repo(Google 的 repo 工具) 在多仓库管理上的差异
git
玉米很好吃1 小时前
电脑常用参数
windows·电脑
木易双人青1 小时前
git常用命令
git
哇咔咔哇咔2 小时前
Windows下载、安装并运行MinIO,访问WebUI界面
windows·oss
Whoami!2 小时前
⓫⁄₄ ⟦ OSCP ⬖ 研记 ⟧ Windows权限提升 ➱ 搜索Windows的敏感信息
windows·网络安全·信息安全·信息收集
热忱11282 小时前
Git 全套常用命令手册(含日常开发示例)
大数据·git·elasticsearch·搜索引擎