SSH authentication for git push to a PR branch? #24018
-
I’ve been reviewing a pull request to a project I maintain, and wanted to add a commit to the PR. I have hidden the people, project and branch names below since those details shouldn’t matter. Towards the bottom of the PR’s page it says
I’ve been using SSH for all my git interactions with GitHub for years, so I ran this command to do just that:
Having to switch to https with a password seemed strange, but it did work (once I’d looked up my password). However I immediately received a Deprecation Notice email from The GitHub Team:
The blog post above implies I can use an SSH key for Git all authentication with GitHub, but I wasn’t able to do that to push to my reporter’s branch. Is that ability just not in place yet, did I find someplace they missed, did I make a mistake somehow, or is this particular case not going to be supported at all? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
@anjohnson, welcome to the community Does it work if you use |
Beta Was this translation helpful? Give feedback.
-
That is wrong isn’t it, yet I copied it from the PR’s command line instructions “Checkout via command line” section with the Git option selected which I assumed would be the same as SSH but evidently isn’t, maybe that’s what needs fixing. I thought selecting that used to update the URLs in the full list of instructions but it doesn’t seem to now; the repo’s Clone pull-down does gives the right syntax for “SSH”, and doesn’t have a “Git” option at all. The recommendation in the “remote error:” message from my Okay, thanks @byrneh – my mistake, although GitHub could make some improvements to help people like me avoid making it in the future. |
Beta Was this translation helpful? Give feedback.
-
anjohnson:
Hi @anjohnson, most importantly you are up and working with SSH again which is good news :slight_smile: I will admit it confused me when I first looked at your post. Then looking at your post for a while, eureka I realised that it was not saying you cannot use SSH and must use HTTPS, the logic thought your had mistyped your HTTPS syntax as the URL (: afterwards) you entered was HTTP syntax other that you had ‘git’ before the : rather than ‘https’. Which in your case was incorrect. If the error message had given both SSH and git examples formats you would have known your error at once. There is good probability the error message is from your Git client rather than GitHub server. But that is not something I know for a fact one way or the other. |
Beta Was this translation helpful? Give feedback.
@anjohnson, welcome to the community
Your SSH remote syntax looks incorrect.
Does it work if you use
git@github.com:USERNAME/REPOSITORY?