The following command clones Example repository from gerrit server。If it is successful,that means the client and gerrit server has setup correct authentication.
1. Run git clone command
$ git clone ssh://<user name>@gerrit.yuneec.com:29418/Example
正克隆到'Example'...
remote: Counting objects: 12, done
remote: Finding sources: 100% (12/12)
remote: Total 12 (delta 1), reused 12 (delta 1)
接收对象中: 100% (12/12), 1.13 KiB | 0 bytes/s,完成.
处理delta中: 100% (1/1),完成.
2. Copy commit-msg, which is required once for one git.
$gitdir=$(git rev-parse --git-dir); scp -p -P 29418 <user name>@gerrit.yuneec.com:hooks/commit-msg ${gitdir}/hooks/
If your client user name like Ubuntu user name is same as the domain name, you needn't add user name like this,
$ git clone ssh://gerrit.yuneec.com:29418/Example
Otherwise you'll get this error, because the gerrit server doesn't recognize the connecting user name.
Cloning into 'Example'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights