如何下载GitHub一部分文件(一部分目录、某个文件夹、某个文件)

您所在的位置:网站首页 gitclone部分文件夹 如何下载GitHub一部分文件(一部分目录、某个文件夹、某个文件)

如何下载GitHub一部分文件(一部分目录、某个文件夹、某个文件)

2024-07-10 13:13| 来源: 网络整理| 查看: 265

背景

我们有时候需要下载GitHub中某个仓库的部分目录而不是整个,怎么办?

方法1 使用 https://minhaskamal.github.io/DownGit/#/home 在GitHub中切换好你要下载的分支,进入到你要下载的GitHub的目录,拷贝网页链接到DownGit的输入框中 直接在该网站点击 Download 即可下载(也可以复制下载链接后在浏览器打开或下载工具中打开)

注意:下载看来是经过了第三方的网站,有可能会在这个网站留下下载日志甚至下载包。不过由于是外国的网站比起国内的网站可信一点。

使用 http://blog.luckly-mjw.cn/tool-show/github-directory-downloader/index.html 方法同上。不过这个是国人的(请自行斟酌风险) 方法2(麻烦一些,但是是最保险的)

假设要下载的仓库是

master分支: https://github.com/xxxxx/test-download-partial-dir/tree/master/resource1 替换 /tree/master/ 为 /trunk/ 得到 https://github.com/xxxxx/test-download-partial-dir/trunk/resource1 在命令行中使用 svn checkout 这个地址develop分支: https://github.com/xxxxx/test-download-partial-dir/tree/develop/resource1 替换 /tree/develop/ 为 /branches/your_branchname/ 比如替换成 https://github.com/xxxxx/test-download-partial-dir/branches/develop/resource1 然后用 svn checkout 这个地址


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3