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
相关推荐
BestOrNothing_20152 小时前
Git 中新建学习分支 + 暂存修改 + VSCode 可视化查看改动(超详细教程)
git·vscode·版本控制·开发技巧
正经教主2 小时前
【Git】Git03:Git版本回退、文件修改与撤销
git
QX_hao2 小时前
【git】--远程Git仓库的名称发生更改
git
百***68043 小时前
Node.JS 版本管理工具 Fnm 安装及配置(Windows)
windows·node.js
正经教主4 小时前
【Git】Git04:分支管理
git
secondyoung5 小时前
Mermaid流程图高效转换为图片方案
c语言·人工智能·windows·vscode·python·docker·流程图
!chen7 小时前
Zabbix 配置中文界面、监控告警以及Windows、Linux主/被监控模板
linux·windows·zabbix
qq_3168377510 小时前
华为CCE k8s 使用nfs-subdir-external-provisioner 创建pvc时自动创建pv
windows·华为·kubernetes
呉師傅10 小时前
国产化操作系统---银河麒麟安装步骤(简单介绍)
运维·网络·windows·单片机·电脑
百***256110 小时前
MySQL 实验1:Windows 环境下 MySQL5.5 安装与配置
windows·mysql·adb