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
相关推荐
w***Q3502 小时前
Git工作流自动化
运维·git·自动化
tobebetter95274 小时前
How to manage python versions on windows
开发语言·windows·python
q***71856 小时前
windows下安装并使用node.js
windows·node.js
舒一笑7 小时前
GitPulse:让代码的故事自己讲述
git·程序员·intellij idea
q***92517 小时前
Windows上安装Go并配置环境变量(图文步骤)
开发语言·windows·golang
5***o5008 小时前
Git在代码中的GitHub
git·github
还是会想她9 小时前
git 常见命令
git
凭栏落花侧9 小时前
打印机脱机状态应该怎么处理
windows
q***577410 小时前
MySQL 实验1:Windows 环境下 MySQL5.5 安装与配置
windows·mysql·adb
q***318310 小时前
Windows安装Rust环境(详细教程)
开发语言·windows·rust