文章目录
- 1. 暂时没找到方法用git命令方便地clone单个文件/文件夹
- 2. 通过wget手动下载单个文件
1. 暂时没找到方法用git命令方便地clone单个文件/文件夹
复杂,未测试 https://www.cnblogs.com/impw/p/15629514.html
2. 通过wget手动下载单个文件
在github/gitee网页上浏览时浏览器显示的文件链接不能直接用来下载,需要转换一下,把链接中的blob
替换为raw
即可,例如:
- 原始链接:https://github.com/nlohmann/json/blob/develop/CMakeLists.txt
- 转_换_成:https://github.com/nlohmann/json/raw/develop/CMakeLists.txt
然后就可以使用wget下载了:
- wget https://github.com/nlohmann/json/raw/develop/CMakeLists.txt