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)

相关推荐
GoGeekBaird2 小时前
我开源了 BeeWeave,给 AI Agent 搭一个越用越懂你的知识创作台
后端·github
fthux3 小时前
GitZip Pro 源码解析:一个 GitHub 文件/文件夹下载扩展是如何工作的(一)整体架构与扩展入口
人工智能·ai·开源·github·open source
第一程序员4 小时前
Rust Agent 子进程执行:Command 之前,先定义输入和超时
python·rust·github
2501_936960366 小时前
GitHub初步了解
github
wangruofeng7 小时前
11 万 Star 的生成式 AI 入门课,Microsoft 做对了什么
github·aigc·ai编程
敲代码的嘎仔7 小时前
实习日志day6--实习日志day6--title命名规范化&businessType纠正&补充缺失的@Log注解&报警与通信模块补充&产出阶段总结文档
java·开发语言·人工智能·git·python·实习·大二
IOT那些事儿7 小时前
GitHub Profile 429: Too Many Requests
github·profile·429
峰向AI7 小时前
Agent 看不了视频?这个 7K Star 的开源插件一招搞定
github
程序员吕洞宾8 小时前
开源多维表格SmartTable V1.6:自动化工作流,把重复操作交给系统即可
开源·自动化·github·多维表格·飞书多维表
zqx_78 小时前
【无标题】
github