come from : https://blog.csdn.net/Winva/article/details/50738932
2.2. 建立产品基线
2.2.1. 从高通或者谷歌的网站下载repo.git
https://www.codeaurora.org/cgit/quic/la/tools/repo/
git clone git://codeaurora.org/quic/la/tools/repo
由于高通用的是caf-stable分支,所以我们要
$ git checkout caf-stable
2.2.2. 把repo上传到本地服务器
服务器上创建git
ssh -p 29418 hwh@192.168.5.42 gerrit create-project -p All-Projects -n tools/repo –empty-commit
Push git到服务器
改本地的repo/.git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote “origin”]
url = ssh://hwh@192.168.5.42:29418/tools/repo 此处改为服务器地址
fetch = +refs/heads/:refs/remotes/origin/
[branch “stable”]
remote = origin
merge = refs/heads/stable
[branch “caf-stable”]
remote = origin
merge = refs/heads/caf-stable
git push –tags origin HEAD:refs/heads/caf-stable
2.2.3. 更改repo脚本
更改~/bin/repo
取manifest git时需要用到
REPO_URL = ‘http://192.168.5.42:8081/tools/repo’
REPO_REV = ‘caf-stable’
2.2.4. 建立manifest git
ssh -p 29418 hwh@192.168.5.42 gerrit create-project -p All-Projects -n platform/manifest –empty-commit
在http://192.168.5.42:8081/上用图形界面创建platform/manifest 的分支:qmc-8974-la-4.0.2-ref
$ repo init -u http://192.168.5.42:8081/platform/manifest.git -b qmc-8974-la-4.0.2-ref
fatal: manifest ‘default.xml’ not available
fatal: manifest default.xml not found
需要新建default文件
从别处复制default.xml到.repo/manifests,然后改动default.xml
cd.repo/manifestscd.repo/manifests git add .
gitcommit−m“XXX”gitcommit−m“XXX” git push ssh://hwh@192.168.5.42:29418/platform/manifest HEAD:refs/for/qmc-8974-la-4.0.2-ref
在服务器上Merge这个commit,然后重新repo init
$ repo init -u http://192.168.5.42:8081/platform/manifest.git -b qmc-8974-la-4.0.2-ref
$ ll .repo/
total 20
drwxrwxr-x 5 winva winva 4096 Jan 11 10:04 ./
drwxrwxr-x 3 winva winva 4096 Jan 9 11:37 ../
drwxrwxr-x 3 winva winva 4096 Jan 9 11:50 manifests/
drwxrwxr-x 10 winva winva 4096 Jan 11 10:04 manifests.git/
lrwxrwxrwx 1 winva winva 21 Jan 11 10:04 manifest.xml -> manifests/default.xml
drwxrwxr-x 7 winva winva 4096 Jan 9 11:37 repo/
$ repo sync
这样就可以下载整个代码了。
注意:
1. 我们也可以通过git协议或者ssh协议来下载代码。
2. 以上2.2.1~2.2.3步骤只需要执行一次,以后有新的项目,只需要建立新的manifest分支就够了。