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
相关推荐
docsz2 分钟前
Windows开发环境配置
windows
eggwyw1 小时前
PHP搭建开发环境(Windows系统)
开发语言·windows·php
运维行者_3 小时前
通过OpManager的Windows服务监控能力释放最佳IT网络性能
服务器·开发语言·网络·windows·web安全·php
oscar9994 小时前
Windows下快速安装OpenCode及使用—PowerShell+Chocolatey
windows·opencode
元Y亨H4 小时前
Python 获取 Windows 设备信息笔记
windows·python
xiaoshuaishuai84 小时前
C# Submodule 避坑指南
服务器·数据库·windows·c#
程序员鱼皮4 小时前
Git WorkTree 是什么?凭什么能让 AI 编程效率翻倍?
git·ai·程序员·编程·ai编程
懵逼的小黑子6 小时前
git与远程仓库创建连接
git
IMPYLH6 小时前
Linux 的 shuf 命令
linux·运维·服务器·bash
一个小浪吴啊7 小时前
MacOS/Linux/Windows 跨平台一键安装OpenCode指南
linux·windows·macos·opencode