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设置方式 点击这里查看.

相关推荐
AIMath~11 小时前
向github中上传文件过大超过50M怎么办
网络·git·github
AIMath~15 小时前
如何将一个新的文件夹使用git 工具提交到github新仓库中
git·github
满天星830357716 小时前
【Git】原理及使用(二) (版本回退)
linux·git
愿天垂怜16 小时前
【C++脚手架】ffmpeg 库的介绍与使用
linux·服务器·开发语言·c++·ide·git·ffmpeg
月夜的风吹雨16 小时前
Linux 基础开发工具详解:从 yum 到 gdb 实战指南
linux·git·ubuntu·centos·vim
好运yoo17 小时前
git cherry-pick
git
不是光头 强17 小时前
Obsidian Git 插件安装与配置完全指南
git
.千余18 小时前
【C++】C++核心语法:函数重载与缺省参数原理与避坑
c语言·开发语言·c++·经验分享·笔记·git·学习
meowrain18 小时前
Git HTTPS Token 凭据配置指南
git·网络协议·https
Ws_1 天前
Git + Gerrit 第二课:diff、暂存区与撤销修改
git