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

相关推荐
恋喵大鲤鱼16 小时前
git add
git·git add
jiayong2317 小时前
CI/CD深度解析01-核心概念与原理
运维·git·ci/cd
天麓17 小时前
git 切换用户和邮箱的方法
git
科技道人19 小时前
Launcher allapps界面顶部推荐的app
git·github·launcher·allapps
云水一下19 小时前
平行宇宙的魔法——Git 分支与合并的艺术
git
AI 编程助手GPT20 小时前
ChatGPT 新手入门与实战操作指南
开发语言·人工智能·git·python·chatgpt
MU在掘金9169520 小时前
给AI Agent做一个代码大脑:我用Tree-sitter+ChromaDB+MCP搭了个代码知识库
git·python
甄心爱学习21 小时前
【项目实训】法律文书智能摘要系统7
git·python
cheems952721 小时前
Git 分支管理
大数据·git
不总是1 天前
Windows 系统 Git 下载与安装详细教程
git