请选择 进入手机版 | 继续访问电脑版

平方X

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2483|回复: 0

[2441]git clone较大项目

[复制链接]

414

主题

709

帖子

3602

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3602
QQ
发表于 2017-12-3 15:18:52 | 显示全部楼层 |阅读模式
[md]
下载omegat的时候,文件非常多,而且github还不稳定,后来终于下好了,400多M。
```
Receiving objects: 100% (101728/101728), 437.93 MiB | 984.00 KiB/s, done.
```

于是找到
[kassadin.《github 下载的zip项目如何再关联回去》](http://blog.csdn.net/a06_kassadin/article/details/72592199)  
转到[How to clone git repository from its zip](https://stackoverflow.com/questions/15681643)  
再转到[How to complete a git clone for a big project on an unstable connection?](https://stackoverflow.com/questions/3954852)

# 备注
后来又想到一个方法,但没测试,下载 zip 再使用 --dissociate --reference  
见[git clone 时引用本地仓库](http://blog.pingfangx.com/2428.html)

# 0x01 无效 --bare
[fracjackmac的回复](https://stackoverflow.com/a/31781016)  
```
git clone --bare https://github.com/omegat-org/omegat omegat
```
但是自己测试了一下,还是不行。

# 0x02 无效 init pull
[umläute的答案](https://stackoverflow.com/a/15682258)
```
$ git init
$ git remote add origin https://github.com/user/repo.git
$ git pull
```
实际效果如图,原因应该是我们下载的只是master,pull时又把别的分枝的文件下载了。

# 0x03 无效 init update
[arctelix的回复](https://stackoverflow.com/a/38909009)
同上一个
```
unzip <repo>.zip
cd <repo>
git init
git add .
git remote add origin https://github.com/<user>/<repo>.git
git remote update
git checkout master
```

# 0x04 有效 git clone --depth=1
[Jakub Narębski的回复](https://stackoverflow.com/a/3957733)
效果还不错

# 0x05 有效 git clone --depth <Number> <repository> --branch <branch name> --single-branch
[Ahed Eid的回复](https://stackoverflow.com/a/26488855)[/md]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|平方X ( 冀ICP备14018164号 )

GMT+8, 2024-4-16 14:49 , Processed in 0.118122 second(s), 21 queries .

技术支持:Powered by Discuz!X3.4  © 2001-2013 Comsenz Inc.

版权所有:Copyright © 2014-2018 平方X www.pingfangx.com All rights reserved.

快速回复 返回顶部 返回列表