下载 GitHub 仓库「单个文件夹」的方法

方法1
  1. 打开 GitHub,找到要下载的「目标文件夹」,点击进入这个文件夹的页面
  2. 复制浏览器地址栏里的「文件夹完整 URL」(比如:https://github.com/letere-gzj/live2d-widget-v3/tree/main/Resources
  3. 打开 DownGit 官网: https://minhaskamal.github.io/DownGit/
  4. 把第2步复制的文件夹 URL 粘贴到 DownGit 的输入框里,点击「Download」按钮即可
方法2

可以选择在【桌面】打开命令行窗口:

  1. 初始化克隆仓库
bash 复制代码
git clone --filter=blob:none --no-checkout https://github.com/用户名/仓库名.git
  1. 进入克隆的仓库目录
bash 复制代码
cd 仓库名
  1. 开启「稀疏检出」功能,告诉Git:我只需要指定文件夹
bash 复制代码
git sparse-checkout init --cone
  1. 指定要下载的「单个文件夹路径」(路径从仓库根目录开始写,不用加/)
bash 复制代码
git sparse-checkout set 文件夹路径/文件夹名称
  1. 拉取指定文件夹的所有内容

如果是仓库的其他分支名,比如master分支,需要将main换成master

bash 复制代码
git checkout main  

以下载https://github.com/letere-gzj/live2d-widget-v3/tree/main/Resources这个文件夹举例,依次输入以下指令:

bash 复制代码
git clone --filter=blob:none --no-checkout https://github.com/letere-gzj/live2d-widget-v3.git

cd live2d-widget-v3

git sparse-checkout init --cone

git sparse-checkout set Resources

git checkout main
相关推荐
张洛闻Eren17 小时前
k8s云原生【第十课】:水平 Pod 自动扩缩容
运维·数据库·云原生·kubernetes·github
m4Rk_18 小时前
【论文阅读】Agent 记忆机制(77):TSM——让记忆回到事件真正发生的时间
论文阅读·人工智能·学习·开源·github
橘和柠18 小时前
依赖冲突:装个包装崩了项目,怎么排查和救回来
github
别动我齐刘海20 小时前
ROS2 Jazzy + C++ 实战路线——ros2_control
c++·人工智能·python·opencv·机器学习·机器人·github
怕浪猫20 小时前
ZCode 开源了来看看这是个什么东西
node.js·github·代码规范
demo007x1 天前
我用 AI 做了一个跨平台的PopClip:拾趣Magpie
程序员·github·ai编程
miofly1 天前
GitHub 日榜趋势速报 | 2026-09-22
开源·github
我命由我123451 天前
Git 推送报错:error: src refspec main does not match any
运维·git·gitee·github·运维开发·学习方法·版本控制
阿里嘎多学长1 天前
2026-09-20 GitHub 热点项目精选
开发语言·程序员·github·代码托管