# github_download_tools **Repository Path**: geekheart/github_download_tools ## Basic Information - **Project Name**: github_download_tools - **Description**: 简单的github下载脚本,本质是使用python递归换源,可以使用它下载子模块 - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 28 - **Forks**: 14 - **Created**: 2022-01-24 - **Last Updated**: 2024-07-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # github_download_tools #### 介绍 简单的 github 下载脚本,本质是使用 python 递归换源,可以使用它下载子模块 本脚本只依赖标准 python 库,无需安装其它的库 #### 安装教程 1. 下载并安装 python 2. 下载并安装 git 3. 下载本脚本 4. 调用指令下载 github库 5. 移动库到自己想要存放的地方 #### 使用说明 - 打开帮助 ```bash python gdt.py -h #或者 python gdt.py --help ``` ```bash > 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 库 ```bash python gdt.py https://github.com/espressif/esp-idf.git ``` - 下载带子模块的 github 库 ```bash python gdt.py https://github.com/espressif/esp-idf.git -s ``` - 下载带子模块的 github 库的指定分支 ```bash python gdt.py https://github.com/espressif/esp-idf.git -b release/v4.3 ``` - 下载 github 库并重命名 ```bash python gdt.py https://github.com/espressif/esp-idf.git -n esp_idf ``` - 下载 github 库并指定镜像 ```bash python gdt.py https://github.com/espressif/esp-idf.git -m https://github.com.cnpmjs.org/ ``` - 获取脚本的版本 ```bash python gdt.py -v #或者python gdt.py --version ``` ```bash 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. 本仓库欢迎各位大佬修改,变得更加好用