为什么现在从github上clone代码超慢
答案:2 悬赏:0 手机版
解决时间 2021-03-12 01:39
- 提问者网友:斑駁影
- 2021-03-11 03:45
为什么现在从github上clone代码超慢
最佳答案
- 五星知识达人网友:狂恋
- 2021-03-11 03:56
方法1-克隆(Clone)源代码到本地到github.com找到自己感兴趣的项目,比如Jquery,复制项目的CloneURL在本地打开GitBash命令行窗口把复制好的CloneURL粘贴到命令行窗口并回车,执行完Clone命令代码即下载到本地GitClone[URL]方法2-
全部回答
- 1楼网友:玩家
- 2021-03-11 05:06
1. clone最新一个提交
```
$ git clone --depth=1 git@github.com:atom/atom.git
cloning into 'atom'...
remote: counting objects: 444, done.
remote: compressing objects: 100% (359/359), done.
remote: total 444 (delta 20), reused 264 (delta 8)
receiving objects: 100% (444/444), 2.25 mib | 7.00 kib/s, done.
resolving deltas: 100% (20/20), done.
checking connectivity... done.
```
2. 更新获取完整历史版本
```
$ git fetch --unshallow
remote: counting objects: 98400, done.
remote: compressing objects: 100% (27919/27919), done.
remote: total 98159 (delta 68929), reused 97823 (delta 68611)
receiving objects: 100% (98159/98159), 236.07 mib | 18.00 kib/s, done.
resolving deltas: 100% (68929/68929), completed with 175 local objects.
from github.com:atom/atom
dbe15f7..7cdaaf2 master -> origin/master
remote: counting objects: 7, done.
remote: compressing objects: 100% (7/7), done.
remote: total 7 (delta 0), reused 7 (delta 0)
unpacking objects: 100% (7/7), done.
* [new tag] v0.0.1 -> v0.0.1
* [new tag] v0.0.2 -> v0.0.2
...此处省略91行
* [new tag] v0.92.0 -> v0.92.0
* [new tag] v0.93.0 -> v0.93.0
* [new tag] v0.94.0 -> v0.94.0
```
期间也中断过,和直接clone一样,都不支持续传。
下面的事实可以说明我这里速度有多慢:
unshallow后git status一看:
```
$ git st
on branch master
your branch is behind 'origin/master' by 3 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
nothing to commit, working directory clean
```
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯