首页 > 技巧 > git浅克隆一个分支

作者:ghostry 发布时间:2019-01-25 浏览: 5091

转载注明出处: https://blog.ghostry.cn/technique/895.html

github超级慢,克隆openwrt的话,12k的速度clone几百MB实在无法忍受。


发现这个,一句话就行了,不用下面老办法那么麻烦.

git clone -b openwrt-18.06 --depth 1 https://github.com/openwrt/openwrt

首先浅克隆master。

git clone --depth 1 https://github.com/openwrt/openwrt.git

然后修改为需要的分支,直接checkout是不行的,需要

git config remote.origin.fetch '+refs/heads/openwrt-18.06:refs/remotes/origin/openwrt-18.06'
git pull --depth 1
git checkout openwrt-18.06

首先修改了配置,再pull一下。然后checkout
就可以了。

标签: openwrt git github

上一篇: 安利一个项目smartdns
下一篇: 资料库搭建

仅有一条评论 »

  1. 简单明了 感谢分享

添加新评论 »

*
*

欢迎评论!歡迎評論!Comments welcome!komentoj bonvenaj!댓글 오신 것을 환영합니다!
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: :cold: :cryy: :cute: :shy: :sleep: :struggle: :tea: :yahou: