克隆clone github上某个项目的子目录

有时会遇到只需要克隆github某个项目的子目录,此时可以使用以下方法实现:

需求示例:

现需要克隆:https://github.com/SingleZombie/DL-Demos项目中的ddim项目

注:ddim项目的地址为:https://github.com/SingleZombie/DL-Demos/tree/master/dldemos/ddim

Step1: git clone --filter=blob:none --no-checkout https://github.com/SingleZombie/DL-Demos
Step2: cd DL-Demos, 即表示进行到该目录
Step3: git sparse-checkout init --cone
Step4: git sparse-checkout set dldemos/ddim, 其中dldemos/ddim表示https://github.com/SingleZombie/DL-Demos这个目录下的相对路径
Step5: git checkout master, 其中master表示分支,可以在github项目中查看,如下图所示:

详细的代码步骤如下:

复制代码
git clone --filter=blob:none --no-checkout https://github.com/SingleZombie/DL-Demos
cd DL-Demos
git sparse-checkout init --cone
git sparse-checkout set dldemos/ddim
git checkout master
相关推荐
有道AI情报局3 小时前
网易有道龙虾 NAS 服务器部署与实战指南
github
徐小夕4 小时前
JitWord 2.3: 墨定,行远
前端·vue.js·github
CoovallyAIHub7 小时前
实时视觉AI智能体框架来了!Vision Agents 狂揽7K Star,延迟低至30ms,YOLO+Gemini实时联动!
算法·架构·github
CoovallyAIHub7 小时前
开源:YOLO最强对手?D-FINE目标检测与实例分割框架深度解析
人工智能·算法·github
ZengLiangYi7 小时前
写了个脚本,把 Gitee/GitLab 仓库一键批量迁移到 GitHub
github
CoovallyAIHub7 小时前
OpenClaw:从“19万星标”到“行业封杀”,这只“赛博龙虾”究竟触动了谁的神经?
算法·架构·github
徐小夕9 小时前
pxcharts Ultra V2.3更新:多维表一键导出 PDF,渲染兼容性拉满!
vue.js·算法·github
开源之眼10 小时前
《github star 加星 Taimili.com 艾米莉 》为什么Java里面,Service 层不直接返回 Result 对象?
java·后端·github
逛逛GitHub11 小时前
OpenClaw之父多次点名!国产 Agent 进入真干活时代。
github
0xDevNull11 小时前
Linux切换JDK版本详细教程
linux