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
相关推荐
三无少女指南38 分钟前
开发者环境配置最佳实践:编辑器Cursor ,VS Code的上位体验实现 AI 与 WSL 联动
运维·c语言·数据库·windows·git·编辑器
水木姚姚1 小时前
string类(C++)
开发语言·c++·windows·vscode·开发工具
Rhystt2 小时前
furryCTF 题解|Web方向|保姆级详解|固若金汤、DeepSleep
git·python·安全·web安全·网络安全
love530love2 小时前
ZeroClaw Reflex UI完整搭建流程——ZeroClaw Gateway + LM Studio + Reflex 本地 AI 管理面板
人工智能·windows·gateway·lm studio·reflex·openclaw·zeroclaw
love530love11 小时前
【ComfyUI】解决 ModuleNotFoundError: No module named ‘inference_core_nodes‘ 问题
人工智能·windows·python·comfyui·inference-core
Bruce_Liuxiaowei12 小时前
Windows系统安全加固——从基础到进阶的实战配置
windows·安全·系统安全
RZcKUXIhvPR15 小时前
基于VSG控制(虚拟同步发电机控制)的模块化多电平变流器MM C 通过设置可编程电源,模拟电网...
windows
电饭叔17 小时前
python转换字符串介绍
开发语言·windows·python
头发那是一根不剩了17 小时前
Git 常用命令
git
x-cmd18 小时前
[x-cmd] x git - Git 命令增强工具
git·终端·命令行·x-cmd