Git:修复Git拉去代码长文件路径无法创建,拉取失败

使用 git clone 拉去代码报错,路径过长无法创建问题

提示错误:

fatal: cannot create directory at 'a/b/c/d/e/f/g.xXx': 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 :/' 

解决方法:

使用 Window 系统管理员进入命令行执行

git config --system core.longpaths true

 

posted @ 2026-03-27 11:38  zgjack  阅读(22)  评论(0)    收藏  举报