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

相关推荐
cos5 小时前
Fork 主题如何更新?基于 Ink 构建主题更新 CLI 工具
前端·javascript·git
OpenMiniServer6 小时前
当 AI 成为 Git 里的一个“人”
人工智能·git
Carry3457 小时前
不清楚的 .gitignore
前端·git
番茄灭世神15 小时前
Git入门使用学习
git·gitee·软件工程·计算机专业入门
南_山无梅落16 小时前
团队协作高频Git实用手册(项目实战版)
git·团队开发
就叫飞六吧17 小时前
git提取当前分支指定文件历史版本
git
数字游民952717 小时前
网站备案全流程回放(腾讯云)
人工智能·git·github·腾讯云·网站备案·waytoopc
Albert Edison17 小时前
【Git】多人协作一(同一分支下)
git·vscode·svn·github
学好statistics和DS17 小时前
Git 同步冲突
大数据·git·elasticsearch
德彪稳坐倒骑驴1 天前
Git常用命令
git