Unable to push my changes to gerrit


#1

I am trying to submit my first patch. When I try to push my changes I am facing this error:

syedsouban@git.haiku-os.org: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

PS: I have logged in on gerrit and also added my ssh keys from my github account.


#2

You’re attempting to push the code directly into our repository here.
Please use git review to make a code review request.


#3

In addition make sure you add your SSH keys to ssh-agent. I was having problems with that when trying to even pull from Gerrit.

https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent


#4

I am using this command to push:

git push origin master:refs/for/master

What is the syntax of git review?


#5

I followed that link and added ssh keys to github and gerrit both. I am still facing the same error!


#6

Facing the same error. I followed the instructions at CodingGuidelines/SubmittingPatches, and added my SSH key.

Should I use my github username, or the username in this forum?


#7

You need to use your Gerrit username. It is listed at https://review.haiku-os.org/settings/

Please show us the output of “git remote -v” so we can see how you have set up your repositories. It should look like this:

origin ssh://pulkomandy@git.haiku-os.org/haiku (fetch)
origin ssh://pulkomandy@git.haiku-os.org/haiku (push)

#8

OK, I am using the right username. The output of git remote -v is

origin  https://review.haiku-os.org/haiku (fetch)
origin  https://review.haiku-os.org/haiku (push)

Maybe https does not allow push?


#9

For http you would need to set up a password in Gerrit settings. I recommend switching to ssh, so you don’t need to type a password everytime you want to push something.


#10

It works, thanks.


#11

Output of git remote -v is:

origin ssh://syedsouban@git.haiku-os.org/haiku (fetch)
origin ssh://syedsouban@git.haiku-os.org/haiku (push)