github 下载指定子文件资源

通常,github一个项目下有很多小项目,而整个项目有很大,我只想下载一个怎么办?

例如:这个项目我只想下载docs这个子文件

方法:

1、进入docs文件目录,复制它上方的url链接,可以得到 https://github.com/IdentityServer/IdentityServer4/tree/main/docs 这个链接,细心的可以注意到,凡是项目下的子文件都带有 tree/main 类似的字段。

2、把这个字段替换成 trunk 下面是完整的地址 https://github.com/IdentityServer/IdentityServer4/trunk/docs  

3、本地cd到你要检出的目录 ,使用svn的命令,前提是装上svn工具,一个和git相同功能的工具,使用命令

svn checkout https://github.com/IdentityServer/IdentityServer4/trunk/docs

就可以检出了,完!

原文地址:https://www.cnblogs.com/yangchas/p/13539380.html