下载 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
相关推荐
goplaysource5 小时前
IPTV 频道去重:用哈希解决"同一个频道出现十遍"的问题
github
liuyicenysabel5 小时前
从 0 到 1:一套 GitHub + GHCR + k3s 的全自动 CI/CD 流水线(Flask 项目实战)
ci/cd·flask·github
u1301307 小时前
GitHub 热榜项目:日榜(2026-08-31)
github
Justinsky7 小时前
DeepSeek Harness 开源一个月,我把它整个嵌进了 Electron 桌面软件
github
小宋10217 小时前
MCP 是什么:从零编写一个可供 AI 调用的工具服务
人工智能·github
小弥儿9 小时前
GitHub今日热榜 | 2026-09-01:迷你小模型登场
学习·microsoft·开源·github
QUOR9 小时前
Zorv AI 内置浏览器技术架构与开发指南(新版)
架构·github
u1301309 小时前
GitHub 热榜项目:日榜(2026-09-01)
github
younuo36559 小时前
广州网站搭建费用明细:域名、服务器与开发成本全解析
服务器·前端·github
百变梦仔9 小时前
Codex 启动回复合格后,我会用三类证据验收前端改动
前端·github