由于repo是通过manifest.xml文件来管理多个git库的
进行此的前提是你已经搭建好了gerrit并配置好了repo
配置repo文件:http://mp.blog.csdn.net/postedit/79250492
搭建gerrit:http://mp.blog.csdn.net/postedit/79250373
1.server端 默认在git目录下,建立空git库
git init –bare manifest.git(默认采用 manifest的名称)
2.建立此移植测试的两个git库:
git init –bare test/test01git
git init –bare test/test02.git
3.1 git clone http://192.168.0.102:8081/manifest
3.2 cd manifest
3.3 创建本地分支:git checkout -b work
3.4 manifest文件的写法介绍:http://blog.csdn.net/nwpushuai/article/details/79252297
vim test.xml
<?xml version="1.0" encoding="UTF-8"?><manifest>
<remote name="test"
fetch="ssh://192.168.0.102:29418"
review="http://192.168.0.102:8081" />
<default revision="master"
remote="test"
sync-j="4" />
<project path="test/test01" name="test/test01" />
<project path="test/test02" name="test/test01" />
</manifest>
3.5在使用本地git commit提交后就可以用 git push origin HEAD:refs/for/master提交到server端了
4.测试此移植是否成功
repo init -u http://192.168.0.102:8081/manifest -m test.xml;repo sync即可
如果对repo使用不熟,可先看看:http://blog.csdn.net/nwpushuai/article/details/78778602