下载 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
相关推荐
m0_6948455714 小时前
tinylisp 是什么?超轻量 Lisp 解释器编译与运行教程
服务器·开发语言·云计算·github·lisp
June`14 小时前
muduo项目排查错误+测试
linux·c++·github·muduo网络库
weixin_66817 小时前
GitHub 2026年AI项目详细数据汇总表-AI分析-分享
人工智能·github
CoderJia程序员甲1 天前
GitHub 热榜项目 - 日榜(2026-02-05)
ai·开源·大模型·github·ai教程
weixin_6681 天前
GitHub 2026年AI项目热度分析报告-AI分析-分享
人工智能·github
MicrosoftReactor1 天前
技术速递|GitHub Copilot CLI 斜杠命令速查表
github·copilot·cli
wu~9702 天前
GitHub永不遗忘,使用git push -f来覆盖的提交依旧保留
git·github
m0_694845572 天前
music-website 是什么?前后端分离音乐网站部署实战
linux·运维·服务器·云计算·github
独自破碎E2 天前
已经 Push 到远程的提交,如何修改 Commit 信息?
开发语言·github
jiang_changsheng2 天前
工作流agent汇总分析 2
java·人工智能·git·python·机器学习·github·语音识别