測試Gerrit SSH連接

測試Gerrit SSH連接

Gerrit安裝好之後,我們需要只有將gerrit上的clone下來,才能進行修改提交,並進行review。

gerrit支持兩種方式下載代碼:ssh和http。

使用ssh的連接操作如下:,gerrit網址url爲:http://review.gerritsite.com/

1.本地生成ssh key,並貼到gerrit上。

2.測試鏈接

公鑰添加到gerrit上之後,就可以通過ssh命令來測試連接,gerrit的ssh默認端口號是29418;如果出現如下內容,表示連接成功。
  $ ssh -p 29418 [email protected]

    ****    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://[email protected]:29418/REPOSITORY_NAME.git

  Connection to hostname closed.

3.獲取端口信息

通過curl命令,獲取gerrit網站的ssh信息
$ curl http://review.gerritsite.com/ssh_info
review.gerritsite.com 29418
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章