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

相关推荐
Ws_5 小时前
Git + Gerrit 第二课:diff、暂存区与撤销修改
git
snowjlz6 小时前
鸿蒙版SVN来了!!!
git·svn·版本控制
2401_876964138 小时前
27考研余炳森概率论|喻老李良2027资料网课
windows·git·考研·svn·eclipse·github·概率论
爱搬砖的狮子9 小时前
【Git】git repo下载使用
git
cheems952712 小时前
Git基本操作
git
Irissgwe12 小时前
三、Git 文件状态管理:add、commit、status 和 diff
git
Ws_16 小时前
Git + Gerrit 第三课:分支、切换与合并
git·elasticsearch
xlq2232217 小时前
6.git
git
Drache_long18 小时前
Git命令概述
git
console.log('npc')18 小时前
修改git中commit内容
git