【原文链接】git clone出现fatal: unable to checkout working tree报错的解决办法

文章目录

  • 问题:当使用git clone 出现fatal: unable to checkout working tree错误,如下
  • 原因分析
  • 解决办法

问题:当使用git clone 出现fatal: unable to checkout working tree错误,如下

$ git clone git@gitee.com:redrose2100-open-euler/lkp-tests.git
Cloning into 'lkp-tests'...
warning: templates not found in .git_template
remote: Enumerating objects: 76628, done.
remote: Counting objects: 100% (76628/76628), done.
remote: Compressing objects: 100% (20653/20653), done.
remote: Total 76628 (delta 53651), reused 76628 (delta 53651), pack-reused 0
Receiving objects: 100% (76628/76628), 17.05 MiB | 2.16 MiB/s, done.
Resolving deltas: 100% (53651/53651), done.
error: invalid path 'monitors/pmeter:yokogawa-wt310'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

原因分析

出现错误一般是里面有文件长度超过了windows系统最大限制,在win7已经之前的windows系统,目录文件的最长限制为260个字符,到win10系统时,则可以修改此限制,加入是win7系统,则基本没有太好的解决办法,可以考虑到linux下载代码后将最长的文件路径做一些修改,但是如果是从开源上下载的代码,则不能这么操作。在这里也建议在开源代码仓上上传文件的时候尽量考虑一下这个问题,毕竟我们很多人都是在windows上进行开发调试的。而且出现长度超过260个字符的其实从另一个方面要考虑一下文件或文件夹的命名是否合理了。

解决办法

假如是使用win10系统,则可按照如下步骤设置win10的配置,解除260个自负的限制

(1)首先,按Win+R 组合快捷键,在打开运行,在框中输入regedit,点击确定打开注册表;

(2)然后,在注册表中依次展开:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Policies;

(3)在右侧,创建一个名为LongPathsEnabled的新的32位DWORD值,将值数据设置为1,

(4)设置完成后如下:

(5)最后再重启,或者注销重新登录即可将文件名解除260字符限制。

git clone出现fatal: unable to checkout working tree报错的解决办法相关推荐

  1. git clone 时出现fatal:unable to access 如下情况报错及解决办法

    克隆公司的项目直接是git clone +远程项目地址,一般是没问题的,但是最近发现想要再克隆一份时报错,之前操作都没问题,很郁闷,网上查了各种办法,也试了很多,都不管用,没找到根本问题. 后来在同事 ...

  2. git clone时出现的报错及解决办法

    报错问题: fatal: HTTP request failed 解决办法: 1.执行#git config --global http.sslVerify false 2.也可能是由于Git的版本太 ...

  3. git clone 出现fatal: unable to access https://github 解决方法

    git clone 出现fatal: unable to access https://github 类错误解决方法 git clone 遇到问题: ① fatal: unable to access ...

  4. TS:git clone出现 fatal unable to access ‘httpsgithub.com...‘的解决办法(已解决)-2021.12.04

    TS:git clone出现 fatal: unable to access 'https://github.com/-'的解决办法(已解决)-2021.12.04 目录 文章目录 TS:git cl ...

  5. git clone出现fatal: unable to access Failed to connect to github.com port 443: Timed out解决方案

      大家好,我是爱编程的喵喵.双985硕士毕业,现担任全栈工程师一职,热衷于将数据思维应用到工作与生活中.从事机器学习以及相关的前后端开发工作.曾在阿里云.科大讯飞.CCF等比赛获得多次Top名次.现 ...

  6. GitLabCICD实战----在.gitlab-ci.yml文件的步骤中使用git clone 另一个代码仓报错的解决办法

    更多信息请关注 个人网站 一.背景 在有些时候,比如在一个项目中,产品的代码是java代码仓,自动化测试脚本是python语言,单独存放的代码仓,在使用GitlabCICD构建流水线的时候有这样一种场 ...

  7. git clone 出现fatal: unable to access ‘https://github 类错误解决方法

    git clone 遇到问题:fatal: unable to access 'https://github.comxxxxxxxxxxx': Failed to connect to xxxxxxx ...

  8. git clone 出现fatal: unable to access ‘https://github.com/xxx: Failed to connect to github.com

    问题描述: 使用git clone命令时,出现如下错误: fatal: unable to access 'https://github.com/xxx': Failed to connect to ...

  9. git clone 问题 fatal: unable to access

    git clone 遇到问题 Cloning into 'warp-ctc'... fatal: unable to access 'https://github.com/SeanNaren/warp ...

最新文章

  1. Spring MVC入门
  2. 大学生目前普遍存在的问题,看你中招了没?
  3. 设计原则——依赖倒置
  4. 统计学习方法第十一章作业:随机条件场—概率计算问题、IIS/GD学习算法、维特比预测算法 代码实现
  5. python 数字转十六进制_在Python中将整数转换为十六进制
  6. Docker 入门(1)虚拟化和容器
  7. 内核下枚举进程 (二)ZwQuerySystemInformation
  8. wooden sticks
  9. 运行yum update出现一下错误信息
  10. java中递归算法_java中递归算法是什么怎么算的?
  11. 计算机的超级终端程序无法使用,超级终端,教您win7怎么添加超级终端
  12. 印象笔记mac版 同步问题_印象笔记国际版无法登陆/同步问题
  13. Python批量转换png图片为ico
  14. Java使用DES加密解密
  15. 使用Excel条件格式-重复值
  16. 【深入理解多线程】 Moniter的实现原理(四)
  17. xf0x9f java mysql_MySql导入数据报错Incorrect string value: ‘xF0x9Fx90x82’
  18. Dev GridView 隔行换色的方法
  19. 调用腾讯云使用图像验证码
  20. windows重装系统之后,开机显示“An operating system wasn't found,Try disconnecting any drives that...”(亲身遇到+解决方法)

热门文章

  1. 基于MATLAB的图片中字符的分割与识别
  2. Deprecated:function eregi() is deprecated in /usr/local/apache/libraries/lib_lang.php on line 8
  3. Tortoise commit提交模板配置
  4. 关于统计检验中P值的解释
  5. 奇虎360scribe日志采集系统
  6. 10年测试工程师的工作感悟,写给还在迷茫中的朋友
  7. 斯特林数 java实现_斯特林数 - BILL666 - 博客园
  8. 【优化调度】基于粒子群算法求解水火电调度优化问题含Matlab源码
  9. 【R语言】沈阳地铁数据处理及站间流量统计——R语言第五次实训
  10. vbs过程参数--byref和byval