Github 下载指定文件夹(git sparse-checkout)

比如要下载这里的 data_utils

步骤

1、新建空文件夹,并进入新建的空文件夹。

2、git init 初始化

3、git remote add origin 添加远程仓库

4、git config core.sparsecheckout true 允许稀疏检出

5、git sparse-checkout set 设置需要拉取的文件夹(可以同时拉取多个,中间加空格即可)

6、git pull origin main 拉取

添加

在已经进行过稀疏检出的文件夹中,添加其它文件夹。

使用git sparse-checkout add

结果:

ps:git sparse-checkout 和 git lfs 不兼容

参考资料:

https://www.git-scm.com/docs/git-sparse-checkout(官方文档)

https://blog.csdn.net/shelutai/article/details/123116973

https://zhuanlan.zhihu.com/p/57390306

https://cloud.tencent.com/developer/article/2008489

https://github.com/git-lfs/git-lfs/issues/3803(git lfs issue)

相关推荐
苏灿烤鱼8 小时前
没有机密文件,也没有付费数据,在浏览器里造一颗"间谍卫星"
前端·javascript·github
粥里有勺糖10 小时前
视野修炼-技术周刊第131期 | Bun 与 pnpm Rust 化
前端·github·agent
旅之灵夫13 小时前
【GitHub项目推荐--HyperFrames:用 HTML 写视频,为 AI Agent 而生的渲染框架】
github
峰向AI14 小时前
阿里内部用了2年的代码审查工具开源了:21k Star背后的「工业级」设计
github
zandy101114 小时前
2026vibe coding背后 :Kimi Code、Cursor、Claude Code、GitHub Copilot等五款工具架构演进全面分析
架构·github·copilot
zandy101115 小时前
网络支付合规三重门:Kimi Code、Cursor、GitHub Copilot等五款AI编程工具国内实战测评
github·copilot·ai编程
ssshooter17 小时前
Tauri + GitHub Actions 自动化发布 Android APK 技术总结
android·github·android studio
wdfk_prog17 小时前
GitHub push 失败:如何扫描并清理 Git 历史中的大文件
git·elasticsearch·github
Da Zeng18 小时前
快速搭建GitHub Page
github
明月_清风19 小时前
GitHub Actions 从入门到实战:一文搞懂 CI/CD 自动化
后端·ci/cd·github