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

相关推荐
落雪小轩韩8 分钟前
Git 常用操作与注意事项全攻略
大数据·git
winds~8 分钟前
【Git】git的回退功能
大数据·git·elasticsearch
Ring__Rain10 分钟前
git fetch的使用
git
b1ng9 小时前
新人程序员 Git 一站式指南
git·github
程序员的世界你不懂10 小时前
IDE 关联 Git 操作
ide·git
weixin_4284984912 小时前
Git Submodule 介绍和使用指南
git
jingshaoqi_ccc1 天前
GitKraken最后一个免费版本和下载地址
git·github·gitkraken·版本管理工具
乌云暮年1 天前
Git简单命令
git·gitee·github·batch命令
用户1259265423201 天前
使用 Docker 搭建 Gitea 并实现 Git HTTP 自动登录
git
一只毛驴1 天前
谈谈对git stash的理解?
git