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
相关推荐
线上放牧人4 小时前
Windows删除图标缓存
windows·python·pyqt
Koi慢热5 小时前
DayDayMap学术社区体验:卫星网络测绘专题用下来怎么样
网络·人工智能·windows·web安全·网络安全
web守墓人6 小时前
【goed/ui】自定义组件设计思想篇
linux·windows·ui·golang
Hvitur6 小时前
Linux安装Git【离线安装】
git
2601_962364979 小时前
红外活体模组,Windows 设备安全身份入口解析
windows·安全·电脑
易点云徐源10 小时前
(已解决)Photoshop 2020 点击“选择主体”闪退:不用重装,1 个配置切回旧算法解决
windows·photoshop
云计算练习生10 小时前
什么是系统调用?为什么程序访问硬件必须经过它
linux·windows·操作系统·系统调用·操作系统原理
howard200511 小时前
6.4 Git安装与配置
git·安装配置
tryCbest14 小时前
git实现前后端分离项目提交同一个仓库
git·gitee
Mr.朱鹏15 小时前
Git 仓库同时推送到 Gitee 与 GitHub 配置指南
git·gitee·开源·github