当前位置: 首页 > news >正文

【问题解决】git status中文文件名乱码

问题复现

解决办法

在git bash中直接执行如下命令

git config --global core.quotepath false

原因

通过 git config --help 可以查看到以下内容:

core.quotePath

Commands that output paths (e.g. ls-files, diff), will quote “unusual” characters in the pathname by enclosing the pathname in double-quotes and escaping those characters with backslashes in the same way C escapes control characters (e.g. \t for TAB, \n for LF, \ for backslash) or bytes with values larger than 0x80 (e.g. octal \302\265 for “micro” in UTF-8). If this variable is set to false, bytes higher than 0x80 are not considered “unusual” any more. Double-quotes, backslash and control characters are always escaped regardless of the setting of this variable. A simple space character is not considered “unusual”. Many commands can output pathnames completely verbatim using the -z option. The default value is true.

简单看就是默认core.quotepath值为true,git认为这些字符不寻常会将非英文的部分转换成8进制字符。设置core.quotepathtrue就不再转换。

git config 命令常见配置文件有三个作用域,配置生效优先级采用就近原则,即如果当前git仓库配置了某参数就不会到当前用户目录去找同样的配置项,系统目录亦然。

  • --system 作用于整个机器所有git仓库
  • --global 作用于当前用户所有git仓库
  • --local 作用于当前git仓库
http://www.lryc.cn/news/424315.html

相关文章:

  • 探索数据结构:AVL树的分析与实现
  • 使用 C++ 实现简单的插件系统
  • 使用Python创建省份城市地图选择器
  • 【Java 数据结构】Stack和Queue介绍
  • Docker基本语法
  • uniapp 对于scroll-view滑动和页面滑动的联动处理
  • opencv基础的图像操作
  • Java | Leetcode Java题解之第337题打家劫舍III
  • 本地查看的Git远程仓库分支与远程仓库分支数量不一致
  • opencv-python实战项目九:基于拉普拉斯金字塔的图像融合
  • 浅谈JDK
  • 爬虫案例3——爬取彩票双色球数据
  • C++ | Leetcode C++题解之第337题打家劫舍III
  • 软件架构设计师-UML知识导图
  • 在使用transformers和pytorch时出现的版本冲突的问题
  • uniapp粘贴板地址识别
  • C语言 | Leetcode C语言题解之第335题路径交叉
  • TypeScript学习第十三篇 - 泛型
  • 工业智能网关在汽车制造企业的应用价值及功能-天拓四方
  • LLM - 在服务器中使用 Ollama + OpenWebUI 部署最新大模型
  • 重启人生计划-积蓄星火
  • 2024.08.11 校招 实习 内推 面经
  • LCA(Lowest Common Ancestor)
  • 张钹院士:大模型时代的企业AI发展趋势
  • php连接sphinx的长连接事宜以及sphinx的排除查询以及关于sphinx里使用SetSelect进行复杂的条件过滤或复杂查询
  • 抓包分析排查利器TCPdump
  • 八种排序算法的复杂度(C语言)
  • docker compose部署rabbitmq集群,并使用haproxy负载均衡
  • git强制推送代码教程
  • windows C++-高级并发和异步(三)