前提条件:
1、搭建好gerrit服务器:Gerrit安装 http://blog.csdn.net/nwpushuai/article/details/79250373
2、 创建好gpg密钥对:http://blog.csdn.net/nwpushuai/article/details/78736787
1、gerrit服务器端拉取repo库
cd 到你gerrit管理的git目录下
git clone --bare https://aosp.tuna.tsinghua.edu.cn/git-repo
2、在本地clone repo的git库,添加gpg公钥
git clone http://nwpushuai@localhost:29418/repo/git-repo.git
cd git-repo
vi repo
将gpg公钥添加到repo里面的MAINTAINER_KEY即可
REPO_URL='http://nwpushuai@localhost:29418/repo/git-repo'
REPO_REV='stable'
git add .
git commit -m "init"
git push origin HEAD:refs/for/stable #push 到stable分支上,当然也可以push到其他分支上,这就要在repo引导文件修改相应的配置了
merged入库
3、创建tag,并提交到服务器
git tag -s "v1.0"
git describe 如果有显示 v1.0就正确了。
也可以使用 git tag -v v1.0来看看。如果出错就证明你的gpg key每设置好。特别是名称和邮件对了没有。
git push origin --tags // 提交tag到服务器
merged入库
4、修改你的repo
将刚才修改的repo文件复制过来
chmod a+x ~/repo
5、repo init and repo sync
repo init -u url地址