用repo管理自己的仓库

1. repo安装
curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/bin/repo
vi `which repo`
REPO_URL地址改为:https://code.csdn.net/kangear/git-repo.git。
2. 建立自己的manifests.git
服务端创建一个manifest.git 可以在github上建一个:

  可以参考我的:

  https://github.com/anlory/manifest
3. 自定义default.xml
<?xml version="1.0" encoding="UTF-8" ?>
<manifest>
    <remote name="anlory" fetch="git://localhost/" />
    <default remote="anlory" revision="master"/>
    <project path="local_hello" name="helo"/>
    <project path="/xxx/bbb" name="bbb"/>
</manifest>
里边定义了remote,default,project. 
remote可以多个,每个定义了一个远程拉取仓库, fetch是仓库的url, 可以使用表示使用repo init -u url里的url 
default则设置每个项目的默认仓库和默认分支  
project定义了一个项目,它指明一个远程仓库,和clone到本地来后的目录名称.
name为项目的远程仓库名, path 是本地路径
以上代码拉取的项目是git://localhost/helo 


将default.xml 提交到manifest.git

关于xml更详细的可以参考https://blog.csdn.net/shift_wwx/article/details/19557031

4. 下载代码
repo init -u https://github.com/anlory/manifest
repo sync



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值