下载 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
相关推荐
青晚舟14 小时前
AI 时代前端还要学 Docker & K8s 吗?我用一次真实部署经历说清楚
前端·github
星浩AI14 小时前
现在最需要被 PUA 的,其实是 AI
人工智能·后端·github
AI程序员15 小时前
Pi Monorepo 学习指南
github
Renhao-Wan20 小时前
基于 GitHub Actions 构建标准化 CI/CD 流水线——从手动部署到全自动化交付
ci/cd·自动化·github
irpywp20 小时前
Skales:你的本地AI特工
github
CoderJia程序员甲21 小时前
GitHub 热榜项目 - 日榜(2026-03-19)
人工智能·ai·大模型·github·ai教程
多厘21 小时前
使用 opencode 和灵感写一个 mac App (实操版)
前端·github
几许1 天前
高并发强一致性顺序号生成系统 -- SequenceGenerator
java·github
badhope1 天前
GitHub超有用项目推荐:skill仓库--用技能树打造AI超频引擎
java·开发语言·前端·人工智能·python·重构·github