Navigation

    Gpushare.com

    • Register
    • Login
    • Search
    • Popular
    • Categories
    • Recent
    • Tags

    【小技巧-代码篇】如何加速从 GitHub 上克隆代码或下载文件?

    新手教程
    1
    1
    169
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Alice_恒源云
      Alice_恒源云 last edited by Alice_恒源云

      1、如何加速从 GitHub 上克隆代码或下载文件?

      加速克隆代码可以将 github.com 替换为 github.com.cnpmjs.org 的镜像地址。
      如仓库地址为 https://github.com/kelseyhightower/nocode.git
      替换后的地址为 https://github.com.cnpmjs.org/kelseyhightower/nocode.git

      # 原始地址 https://github.com/kelseyhightower/nocode.git
      # github.com 替换为 github.com.cnpmjs.org
      git clone https://github.com.cnpmjs.org/kelseyhightower/nocode.git
      

      下载 GitHub 的 Releases、Raw 文件可以使用 GitHub Proxy 服务。在完整地址前加前缀 https://mirror.ghproxy.com/

      # 原始地址 https://raw.githubusercontent.com/kelseyhightower/nocode/master/README.md
      # 地址加前缀 https://mirror.ghproxy.com/
      curl -L https://mirror.ghproxy.com/https://raw.githubusercontent.com/kelseyhightower/nocode/master/README.md
      

      因为机器的地域差异,不同镜像地址的效果可能不同。如果下载速度仍然不满意可以再测试如下两个:

      FastGit
      GitClone

      1 Reply Last reply Reply Quote 1
      • First post
        Last post