Gerrit安装好以后,咱们须要只有将gerrit上的clone下来,才能进行修改提交,并进行review。git
gerrit支持两种方式下载代码:ssh和http。shell
使用ssh的链接操做以下:,gerrit网址url为:http://review.gerritsite.com/ssh
公钥添加到gerrit上以后,就能够经过ssh命令来测试链接,gerrit的ssh默认端口号是29418;若是出现以下内容,表示链接成功。
$ ssh -p 29418 sshusername@review.gerritsite.com **** Welcome to Gerrit Code Review **** Hi John Doe, you have successfully connected over SSH. Unfortunately, interactive shells are disabled. To clone a hosted Git repository, use: git clone ssh://sshusername@review.gerritsite.com:29418/REPOSITORY_NAME.git Connection to hostname closed.
经过curl命令,获取gerrit网站的ssh信息
$ curl http://review.gerritsite.com/ssh_info review.gerritsite.com 29418