返回> 网站首页 

github下载远程仓库代码

yoours2026-07-31 20:44:35 阅读 21

简介一边听听音乐,一边写写文章。

一、请求代理方式

    1. 设置 HTTP 代理示例:

        git config --global http.proxy http://127.0.0.1:7890

    2. 设置 HTTPS 代理示例:

        git config --global https.proxy http://127.0.0.1:7890

(若代理需要认证,格式通常为 http://user:password@ip:port)

    3. 取消代理设置:

    git config --global --unset http.proxy

    git config --global --unset https.proxy


二、url替换方式

    1. 配置

        git config --global url."https://gh-proxy.org/https://github.com/".insteadOf "https://github.com/"

    2. 取消配置:

        git config --global --unset url."https://gh-proxy.org/https://github.com/".insteadOf


三、常用命令

    1. 一次性把主仓库和所有子模块代码都拉下来

    git clone --recurse-submodules https://github.com/Tencent/ncnn.git

    2. 初始化

    git init

    3. 关联远程仓库

    git remote add origin https://github.com/Tencent/ncnn.git

    4. 调大缓冲区(推荐 1GB)

    git config http.postBuffer 1048576000

    5. 续传下载

    git fetch --recurse-submodules

    6. 检出主分支

    git checkout master

    7. 将子模块的工作目录填充出来

    git submodule update --init --recursive


微信小程序扫码登陆

文章评论

21人参与,0条评论