在提交代碼review的時候可能會出現git
Could not connect to gerrit.
Enter your gerrit username: xxxx
Trying again with ssh://xxxx@review.openstack.org:29418/openstack/oslo.messaging.git
<traceback object at 0xb6fe493c>
We don't know where your gerrit is. Please manually create a remote
named "gerrit" and try again.
Traceback (most recent call last):
File "/usr/bin/git-review", line 1196, in <module>
main()
File "/usr/bin/git-review", line 1110, in main
config['hostname'], config['port'], config['project'])
File "/usr/bin/git-review", line 489, in check_remote
add_remote(hostname, port, project, remote)
File "/usr/bin/git-review", line 344, in add_remote
raise Exception("Could not connect to gerrit at %s" % remote_url)
Exception: Could not connect to gerrit at ssh://xxxx@review.openstack.org:29418/openstack/oslo.messaging.gitiview
could not review.openstack.orgeclipse
手動添加節點gerrit節點ssh
git remote add gerrit ssh://<username>@review.openstack.org:29418/openstack/nova.giturl
someone@someone-ThinkPad-E420:~/oslo.messaging$ git review
Problem running 'git remote update gerrit'
正在獲取 gerrit
ssh: Could not resolve hostname review.openstack.org: Name or service not known
fatal: Could not read from remote repository..net
Please make sure you have the correct access rights
and the repository exists.
error: 不能獲取 gerrit
Problems encountered installing commit-msg hook
The following command failed with exit code 1
"scp :hooks/commit-msg .git/hooks/commit-msg"
-----------------------
.git/hooks/commit-msg: No such file or directorydebug
ssh -vv -p 29418 name@review.openstack.org調試
打印調試信息code
....blog
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/someone/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/someone/.ssh/id_dsa
debug1: Trying private key: /home/someone/.ssh/id_ecdsa
debug1: Trying private key: /home/someone/.ssh/id_ed25519
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).
刪除.ssh目錄,從新生成私密鑰
因爲在國內OpenStack社區gerrit的29418端口被牆,因此你們能夠使用https/http來完成git reiview。
首先,須要登陸review.openstack.org,而後在Settings -> HTTP Password裏,生成一個HTTP密碼,應該是一個大小寫加數字的隨機字符串。
而後經過git remote set-url gerrit https://username:http-password@review.openstack.org/openstack/nova.git
命令把ssh修改爲https方式,固然也能夠用http,通過個人實驗都是能夠的。別忘了把上面字符串中的用戶名/密碼改爲你的gerrit用戶名和上一步生成的HTTP密碼。
引用至http://blog.csdn.net/agileclipse/article/details/38980419