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

相关推荐
何中应1 天前
使用SSH地址拉取远程仓库代码报下面的错误
git
何中应1 天前
Git本地仓库命令补充
git
sun0077001 天前
执行repo sync -c -d -j4以后,提交未git push的代码看不到了。要怎么恢复?
git
胖虎11 天前
Git 一个本地仓库同时推送到两个远程仓库(详细教程)
git·多远程仓库·双远程仓库·git双远程·git备份
春日见2 天前
如何创建一个PR
运维·开发语言·windows·git·docker·容器
stevenzqzq2 天前
git 常用操作
大数据·git
Curvatureflight3 天前
Git工作流最佳实践:从混乱到优雅
git
wu~9703 天前
GitHub永不遗忘,使用git push -f来覆盖的提交依旧保留
git·github
Vermouth_003 天前
git clone的时候提示access denied
git
qq_437657273 天前
清楚本地的git并重新登录
git