zoukankan      html  css  js  c++  java
  • 【Repo】repo mirror 加快代码下载速度

    一、建立本地mirror加快代码下载速度:
    安卓源码是几百个仓库组成的,代码量都是几十GB的。一个kernel都要有1个GB大小。怎么才能快速的下载
    代码呢?那就是本地建个mirror。就是说你下载了好几套代码,每个代码都放在了不同的目录,这几套代码
    很多都是重复的,我们把重复的共享使用一个目录,这个就是mirror。这个mirror主要是git裸仓库。

    具体用法就是在repo init命令中加上这个选项–mirror就行了。初次创建需要在一个空目录下面执行命令。
    一般的会把本地mirror统一放到/home/mirror 路径下面。
    命令如下:

    mkdir -p /home/mirror && cd /home/mirror &&  rm -rf .repo
    
    repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest 
    -b android-4.0.1_r1 
    --repo-url=https://aosp.tuna.tsinghua.edu.cn/tools/repo 
    --repo-branch=stable --mirror
    

    这样就初始化好本地镜像了。然后执行repo sync命令。网络不好的情况请多执行 repo sync 几次。

    如果不是一个空目录是会报错的

    fatal: --mirror is only supported when initializing a new workspace.
    Either delete the .repo folder in this workspace, or initialize in another location.
    

    二、使用本地mirror加快代码下载速度:
    本地mirro创建完成后,以后的repo init命令中就可以使用了。具体用法是 repo init 命令中 加上–reference /home/mirror
    这样就指定使用/home/mirror路径下面的本地镜像仓库了。这样下代码会很快。

    repo init -u file://[manifest的git的绝对路径] -b [分支] -m [xml位置] --reference=/[mirror的绝对路径]
    
    repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest 
    -b android-4.0.1_r1 
    --repo-url=https://aosp.tuna.tsinghua.edu.cn/tools/repo 
    --repo-branch=stable --reference  /home/mirror
    
  • 相关阅读:
    centos ssh远程登陆
    Vim 技巧
    php and js to facebook登陆 最佳实践
    vim 编辑器常规操作
    js 函数定义三种方式
    ORDER BY 默认升序排列
    sql = 和<>遵循的sql-92标准的设置SET ANSI_NULLS ON
    添加FB登陆时,需要curl扩展
    array(1) { [0]=> int(5) }和array(1) { [0]=> string(1) "5" }
    Android第三方推送引擎比较
  • 原文地址:https://www.cnblogs.com/wucaiyun1/p/12656355.html
Copyright © 2011-2022 走看看