60.a27059ce.js 4.1 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[60],{389:function(t,s,a){"use strict";a.r(s);var e=a(3),r=Object(e.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"github加速下载项目的方法"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#github加速下载项目的方法"}},[t._v("#")]),t._v(" GitHub加速下载项目的方法")]),t._v(" "),s("p",[t._v("国内在github上克隆项目总是异常的慢,据我多次克隆观察,下载速度最快就20k/s左右,特别是在克隆比较大的项目时简直慢得无法忍受!下面介绍一种加载克隆项目的方法。")]),t._v(" "),s("p",[s("img",{attrs:{src:"https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200309112604.png",alt:""}})]),t._v(" "),s("h2",{attrs:{id:"利用码云来转接做下载加速"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#利用码云来转接做下载加速"}},[t._v("#")]),t._v(" 利用码云来转接做下载加速")]),t._v(" "),s("ol",[s("li",[s("p",[t._v("首先你得有一个 "),s("a",{attrs:{href:"https://gitee.com/",target:"_blank",rel:"noopener noreferrer"}},[t._v("码云"),s("OutboundLink")],1),t._v(" 的账号")])]),t._v(" "),s("li",[s("p",[t._v("登录码云之后在页面右上角的加号选择"),s("code",[t._v("从GitHub/GitLab导入项目")])]),t._v(" "),s("p",[s("img",{attrs:{src:"https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200309112711.jpg",alt:""}})])]),t._v(" "),s("li",[s("p",[t._v("选择"),s("code",[t._v("从URL导入")]),t._v(",粘贴从GitHub复制来的仓库地址,然后导入,这个导入过程一般是很快的。")]),t._v(" "),s("p",[s("img",{attrs:{src:"https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200309112710.jpg",alt:""}})])]),t._v(" "),s("li",[s("p",[t._v('从码云克隆刚导入的这个项目,克隆速度会快很多,网速好的能达到几兆每秒(具体速度就看你的网速了,吐槽一下我家网速,总在关键时刻显示"视频加载中"....)')]),t._v(" "),s("p",[s("img",{attrs:{src:"https://cdn.jsdelivr.net/gh/xugaoyi/image_store/blog/20200309112712.jpg",alt:""}})])]),t._v(" "),s("li",[s("p",[t._v("另外要注意的一点,克隆下来的项目关联的是码云的仓库,如果你需要关联github仓库需要更改远程仓库。")]),t._v(" "),s("div",{staticClass:"language-bash line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("git")]),t._v(" remote "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-v")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# 查看关联的远程仓库")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("git")]),t._v(" remote "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("rm")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("仓库名"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# 删除远程仓库")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("git")]),t._v(" remote "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("仓库名"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("远程仓库地址"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# 关联远程仓库,仓库名一般使用origin")]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br")])])])]),t._v(" "),s("p",[t._v("这个方法适合用于克隆比较大的项目,如果克隆小项目,20k/s的速度好像还能将就~~")])])}),[],!1,null,null,null);s.default=r.exports}}]);