问题复现

解决办法

在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仓库

【问题解决】git status中文文件名乱码的更多相关文章

  1. 【Mac + Git】之git status中文文件名编码问题解决

    一.现象: 命令行输入:git status时,显示中文名乱码问题 二.解决办法: 命令行输入: git config --global core.quotepath false 通过将git配置变量 ...

  2. git status中文文件名编码问题解决

    在默认设置下,中文文件名在工作区状态输出,中文名不能正确显示,而是显示为八进制的字符编码. 通过将git配置变量 core.quotepath 设置为false,就可以解决中文文件名称在这些Git命令 ...

  3. 解决git status中文路径乱码

    这个问题就放一张图吧: 不过需要注意,这样设置了之后对 git status 命令输出的路径就不做转义处理了,当路径中有空格等被terminal视为特殊字符的内容时不要直接复制粘贴使用.

  4. Git Status 中文乱码解决

    现象: jb@H39:~/doc$ git statusOn branch masterYour branch is up-to-date with 'origin/master'. Untracke ...

  5. Java中FTPClient上传中文目录、中文文件名乱码问题解决方法【好用】

    转: Java中FTPClient上传中文目录.中文文件名乱码问题解决方法 问题描述: 使用org.apache.commons.net.ftp.FTPClient创建中文目录.上传中文文件名时,目录 ...

  6. Windows Git中文文件名乱码

    在Windows下使用git,安装包如下: https://git-for-windows.github.io/ 在使用git bash时git 默认中文文件名是 xx% 是因为 对0x80以上的字符 ...

  7. git 中文文件名乱码

    git 默认中文文件名是 \xxx\xxx 等八进制形式,是因为 对0x80以上的字符进行quote. 只需要设置core.quotepath设为false,就不会对0x80以上的字符进行quote. ...

  8. SpringBoot上传文件,经过spingCloud-Zuul,中文文件名乱码解决办法

    最近用springCloud整合springboot做分布式服务发现经过zuul之后上传的中文文件名乱码全都变成?????,从而引发异常,单独用springboot却是好的,在网上找到相关资料总结如下 ...

  9. Ubuntu下解决解压zip文件中文文件名乱码问题

    在Ubuntu下解压Windows下压缩的zip文件时,会出现解压出的带中文文件名的文件名乱码,这是因为Ubuntu和Windows默认的编码不同,Ubuntu下默认的编码是UTF-8,而Window ...

  10. 通过freemarker生成一个word,解决生成的word用wps打开有问题的问题,解决出word时中文文件名乱码问题,解决打开出word时打开的word出现问题的问题,出图片,解决动态列表

     通过freemarker制作word比较简单 步骤:制作word模板.制作方式是:将模板word保存成为xml----在xml的word模板中添加相应的标记----将xml的word文件的后缀名 ...

随机推荐

  1. 随机二次元图片API第三弹

    Tips:当你看到这个提示的时候,说明当前的文章是由原emlog博客系统搬迁至此的,文章发布时间已过于久远,编排和内容不一定完整,还请谅解` 随机二次元图片API第三弹 日期:2020-3-10 阿珏 ...

  2. python 注册nacos 进行接口规范定义

    背景: 一般场景 python服务经常作为java下游的 算法服务或者 数据处理服务 但是使用http 去调用比较不灵活,通过注册到nacos上进行微服务调用才是比较爽的 1.定义feginapi的接 ...

  3. JS神奇的或0(|0)

    按照常识,位运算x|0,要么等于x,要么等于0 那么在JS的世界你的认知就要被颠覆了 下面请看 不带或0运算: (window.crypto.getRandomValues(new Uint32Arr ...

  4. 【路径规划】OSQP曲线平滑 公式及代码

    参考与前言 apollo 代码:https://github.com/ApolloAuto/apollo/tree/master/modules/planning/math/smoothing_spl ...

  5. 【Playwright+Python】系列教程(四)Pytest 插件在Playwright中的使用

    一.命令行使用详解 使用Pytest插件在Playwright 中来编写端到端的测试. 1.命令行执行测试 pytest --browser webkit --headed 2.使用 pytest.i ...

  6. JS 延迟加载

    function sleep(numberMillis) { var now = new Date(); var exitTime = now.getTime() + numberMillis; wh ...

  7. CF372C

    思路 根据题意可以得到dp转移方程是 \(f_{i,j}=\max\{f_{i-1,k}+b_i-|a_i-j|\}\) 而且 \(j-(t_{i}-t_{i-1})\times d\le k\le ...

  8. TIOBE 7月编程排行榜出炉!Python再次出圈

    又到了周三,本周有过半了,大家好呀 ~~ 每月的TIOBE编程排行榜都是技术社区关注的焦点,作为编程语言流行度的晴雨表,它反映了行业趋势和 技术走向.2024年7月的榜单揭晓了一个重要变化:Pytho ...

  9. 使用post请求登陆

    1.使用post请求登陆 import requests import matplotlib.pyplot as plt url = 'https://www.ptpress.com.cn/login ...

  10. 【译】You probably should stop using a custom TaskScheduler

    来自Sergey Tepliakov的 https://sergeyteplyakov.github.io/Blog/csharp/2024/06/14/Custom_Task_Scheduler.h ...