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

相关推荐
一个程序猿老马2 小时前
012、远程协作:连接GitHub/Gitee与git remote
git·gitee·github
Lisonseekpan6 小时前
Git:如何将一个分支的特定提交合并到另一个分支?
java·大数据·git·后端·elasticsearch
pas1367 小时前
git 配置
git
独隅11 小时前
Git误操作急救手册
大数据·git·elasticsearch
水无痕simon11 小时前
03 Git 工作流程
git
一个程序猿老马12 小时前
013、推送与拉取:git push与git pull的协作流程
大数据·git·elasticsearch
每天进步一点点️13 小时前
GIT - 常用命令合辑
git
csdn_aspnet14 小时前
Git Submodule深度避坑指南,破解子模块同步混乱、版本漂移、CI失败等高频协作痛点
git·ci/cd·submodule·checklist·detached·subtree
一个程序猿老马14 小时前
011、更优雅的合并:git rebase变基操作详解
git
zhensherlock17 小时前
Protocol Launcher 系列:Working Copy 文件操作与高级命令详解
javascript·git·typescript·node.js·自动化·github·js