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
相关推荐
边疆.12 小时前
【Linux】版本控制器Git和调试器—gdb/cgdb的使用
linux·服务器·git·gdb调试·cgdb
安冬的码畜日常21 小时前
【JUnit实战3_22】 第十三章:用 JUnit 5 做持续集成(下):Jenkins + JUnit 5 + Git 持续集成本地实战演练完整复盘
git·测试工具·ci/cd·jenkins·集成测试·持续集成·junit5
2401_841495641 天前
Windows 系统中ffmpeg安装问题的彻底解决
windows·python·ffmpeg·bug·语音识别·下载·安装步骤
code_ing-1 天前
【Linux】命令行参数与环境变量
linux·c++·windows·笔记
wxxka1 天前
git使用
开发语言·git
初听于你1 天前
LoRa与ZigBee:物联网双雄对决
服务器·网络·windows·网络协议·计算机网络
舒一笑1 天前
用数据照亮成长之路:PandaCoder Git 统计工具窗口
git·后端·intellij idea
課代表1 天前
WindoWs 系统管理批处理脚本
windows·安全·脚本·注册表·bat·命令·组策略
ShineSpark1 天前
Crashpad介绍
c++·windows
爱尔兰的楠小楠1 天前
Windows上使用WSL2创建Ubuntu系统,实现无缝高效开发的体验
linux·windows·ubuntu