windows下git clone时出现“Filename too long”错误的解决办法

在windows下,当使用git clone复制项目时,出现下述错误表示项目中有文件民字符过长的问题,需要开启git的长路径支持解决:

bash 复制代码
fatal: cannot create directory at 'xxxx': Filename too long
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

方法如下:

  1. 使用管理员模式运行git

  2. 设置系统变量为长路劲有效:

    git config --system core.longpaths true

Note: 如果第二步还是报错,可以设置git全局变量的长路径有效:

复制代码
git config --global core.longpaths true

更多git的 git config设置方式 点击这里查看.

相关推荐
打盹的小pig1 小时前
git pull 报错
git
Tairitsu_H12 小时前
[版本控制器Git] Git 远程仓库 | 多人协作 | 企业级 Git Flow 开发模型
git·版本控制器·远程仓库
我先去打把游戏先12 小时前
Git-Rebase使用指南-从原理到实战
服务器·git·嵌入式硬件·物联网·ubuntu
kaixin_learn_qt_ing15 小时前
我有两个程序,它们在不同的项目中,但是它们复用了一部分头文件,它们在两个不同的git仓库中,有什么好的办法可以让它们复用吗?
git
greatofdream16 小时前
git rebase时如何解决merge节点冲突问题
大数据·git·elasticsearch
敲敲敲-敲代码1 天前
git安装记录
git
我是人✓1 天前
Git入门:从零开始掌握分布式版本控制
分布式·git
Aurora_eye1 天前
Git 笔记
笔记·git
解道Jdon1 天前
FigCraft把Figma用Rust从零重写了一遍
ide·windows·git·svn·eclipse·github·visual studio
橙橙笔记1 天前
QT安卓软件的制作
android·git·qt·软件