您当前的位置: 首页 >  git

石头wang

暂无认证

  • 0浏览

    0关注

    295博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

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

石头wang 发布时间:2022-07-17 06:50:21 ,浏览量:0

背景

我们有时候需要下载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 这个地址
关注
打赏
1663722529
查看更多评论
立即登录/注册

微信扫码登录

0.0356s