3 Star 28 Fork 13

沧御 / github_download_tools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

github_download_tools

介绍

简单的 github 下载脚本,本质是使用 python 递归换源,可以使用它下载子模块 本脚本只依赖标准 python 库,无需安装其它的库

安装教程

  1. 下载并安装 python
  2. 下载并安装 git
  3. 下载本脚本
  4. 调用指令下载 github库
  5. 移动库到自己想要存放的地方

使用说明

  • 打开帮助
python gdt.py -h
#或者 python gdt.py --help
> python gdt.py -h
made by sky kirto
usage: github_download_tools [-h] [-b BRANCH] [-n NAME] [-s] [-m MIRROR] [-v] git_addr

tool version: v1.1

positional arguments:
  git_addr              github repository source URL

optional arguments:
  -h, --help            show this help message and exit
  -b BRANCH, --branch BRANCH
                        github repository branch
  -n NAME, --name NAME  save folder name
  -s, --submodule       github dowload submodule
  -m MIRROR, --mirror MIRROR
                        github domestic mirror
  -v, --version         tools version
  • 下载不带子模块的 github 库
python gdt.py https://github.com/espressif/esp-idf.git
  • 下载带子模块的 github 库
python gdt.py https://github.com/espressif/esp-idf.git -s 
  • 下载带子模块的 github 库的指定分支
python gdt.py https://github.com/espressif/esp-idf.git -b release/v4.3
  • 下载 github 库并重命名
python gdt.py https://github.com/espressif/esp-idf.git -n esp_idf
  • 下载 github 库并指定镜像
python gdt.py https://github.com/espressif/esp-idf.git -m https://github.com.cnpmjs.org/
  • 获取脚本的版本
python gdt.py -v #或者python gdt.py --version
made by sky kirto
v1.1

gdt_config.json 设置

该json方便用户修改镜像源。当本地没有配置文件的时候会生成一个默认配置文件。 当use_custom_mirror为false的时候mirror_num会指定脚本内的第mirror_num个镜像源。当use_custom_mirror为true的时候mirror_num会指定custom_mirror的第mirror_num个镜像源。 custom_mirror则是用户可以添加自己的镜像源。

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

备注

  1. 为了使用方便,最好将本脚本加入系统环境变量里,那么后续的python 脚本名,可以直接调用脚本名在任意路径下运行
  2. 本仓库适用于linux window macos等各个能装git python的平台
  3. 本仓库欢迎各位大佬修改,变得更加好用
MIT License Copyright (c) 2022 沧御 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

简单的github下载脚本,本质是使用python递归换源,可以使用它下载子模块 展开 收起
Python
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/geekheart/github_download_tools.git
git@gitee.com:geekheart/github_download_tools.git
geekheart
github_download_tools
github_download_tools
master

搜索帮助