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

相关推荐
嘻嘻仙人1 天前
Ubuntu中 git上传自己的项目和二次上传一般流程
git·github
Patrick_Wilson1 天前
Squash Merge 的血缘陷阱:为什么删掉的代码又活了过来
前端·git·程序员
沉浸学习的匿名网友1 天前
什么是 .gitignore?为什么每个 Git 项目几乎都离不开它?
前端·git
深海鱼在掘金2 天前
Git 完全指南 —— 第3章:理解工作区、暂存区、版本库三个核心
git
江华森2 天前
Git 基础筑基:从原理到团队协作的全栈实战
git
JakeJiang2 天前
Git 必备命令指南:从日常高频到项目开发实战
git
叫我少年3 天前
Windows 中安装 git
git
深海鱼在掘金8 天前
Git 完全指南 —— 第1章:Git 概览与版本控制演进
git
noravinsc9 天前
关于Git Flow
git
蜜獾云9 天前
在Git中配置用户名和密码
git