Git Clone succeeded, but checkout failed

Clone succeeded, but checkout failed: Filename too long

原因: 由于系统限制,路径太长,无法检出

解决方案:

bash 复制代码
# git允许长路径,在已clone的仓库执行
git config core.longpaths true
# 再次检出
git checkout -f HEAD

关于git config中添加--global或者--system

--local: 默认,仅作用于当前本地仓库, 位于$GIT_DIR/config

bash 复制代码
git config --global core.longpaths true

--global: 作用于当前用户, 位于~/.gitconfig

--system: 作用于所有用户, 位于 $(安装目录)/etc/gitconfig

可以使用git config --list --show-origin --show-scope命令查看配置以及位置

相关推荐
一只积极向上的小咸鱼1 小时前
嵌套 Git 仓库 / gitlink / submodule 问题总结
大数据·git·elasticsearch
LuDvei1 小时前
git拉取报错问题
git
程序猿多布2 小时前
Fork操作笔记
git·fork
荪荪2 小时前
在本地建立git仓库
git
OYangxf3 小时前
Git Rollback, Reset and Restore的使用
git
AIMath~3 小时前
git管理代码仓库的工具
git
techdashen8 小时前
为 Agent 重新设计的 Git:Cloudflare Artifacts 是什么,怎么工作的
git
赖在沙发上的熊8 小时前
Git多仓库协作中和并冲突问题:“不相关历史合并”+“问跟踪文件冲突”
git
风若飞9 小时前
▎ 适用于完全没有 Git 经验的新手
git
时空自由民.11 小时前
git rebase简介
git