We’re trying to set up a Gerrit instance for code reviews and are planning to use ‘repo’ with in.
I am able to push directly to Gerrit, but using repo upload fails with a public key error:
user@machine:~/workspace/git/gerrit-test$ repo upload
Upload project path/gerrit_test/ to remote branch master:
branch master ( 1 commit, Fri Aug 3 15:23:50 2012 -0700):
8ef17a1b this better effin work
to gerrit.test.com:8081 (y/N)? y
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
----------------------------------------------------------------------
[FAILED] path/gerrit_test/ master (Upload failed)
I have narrowed down the problem to the username that is being used for this repo, but have no idea where to set this user name (I’m not sure how to check what user name is being used either).
I’ve tried adding the following in .repo/manifests.git/config but it still fails.
[review "gerrit.test.com:8081"]
username = <my_username_from_gerrit_profile_page>
Where do I add the correct user name?
Thanks.
The gerrit ssh server starts on port 29418, by default. You appear to be connecting to port 8081, which I suspect is the web server port number.
For confirmation check the following section of your “etc/gerrit.config” file:
You can additionally check your private key credentials by running the following command:
I think the reason you are able to “push directly to Gerrit” is because the ssh port number is part of the repository URL.