用repo管理自己的仓库

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/anlory/article/details/80645649

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



猜你喜欢

转载自blog.csdn.net/anlory/article/details/80645649