版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u011391629/article/details/81877021
Overview
- Git:分布式代码版本管理工具
- Gerrit:代码服务器,代码审核
- Repo:在Git进行了包装,Android的代码管理用的Repo
Relation with Git&Gerrit&Repo
What is Git
这个网上很多资料了,就是一个分布式代码管理工具,我就不解释了,写这篇文章的目的主要是想理清楚这三者之间的关系啦。
What is Gerrit
既然git已经是分布式代码版本管理工具,可供多人合作,那为什么还需要Gerrit。虽然git有多份副本,但每个项目通常是有一个代码的权威副本,放在central repository上,那么Gerrit就充当了这样一个角色。同时,Gerrit还充当了Code Review的角色,每个人把代码push到central repository时,会先放到暂存区,需要有review权限的人检查通过后才会真正放到central repository上,这样才算push成功。
那么使用Git&Gerrit的大致Flow是:
- change code
- git commit
- git push (remote) HEAD:refs/for/(branch)
- review
参考资料: Gerrit
What is Repo
Repo相当于是在Git上进行一层包装,这样在Android环境中更容易使用Git。在大多数情况下,可以使用Git而不是Repo,或混合使用Repo和Git。但是,使用Repo进行基本的跨网络操作会更加简单。
Android开发大致Flow是:
- repo start
- change code
- git add
- git commit
- repo upload
参考资料:Repo
Git&Repo Common tasks
更详细的介绍可以看这篇博客:
Git与Repo入门