Mahdiyeh
Mahdiyeh

Reputation: 1194

Github ssh key added, checked, still doesn't work

I created ssh key as per this tutorial.

Assigned it to the ssh-agent.

Added it to the github account as per this tutorial.

ssh-add -l -E md5

Shows correct footprint

ssh -T git@github.com

Says:

Hi <My username>! You've successfully authenticated, but GitHub does not provide shell access.

But still:

git push

Asks for:

Username for 'https://github.com':

Any idea? Thanks in advance.

Upvotes: 6

Views: 7184

Answers (1)

nbari
nbari

Reputation: 27005

Check out this: switching-remote-urls-from-https-to-ssh

High are the changes that you clone your repo over HTTPS and now want to push using SSH.

As suggested on the GitHub site check your remote origin by doing this:

$ git remote -v
origin  https://github.com/USERNAME/REPOSITORY.git (fetch)
origin  https://github.com/USERNAME/REPOSITORY.git (push)

In case you have https... change it to ssh by doing something like this:

git remote set-url origin git@github.com:USERNAME/REPOSITORY.git

Upvotes: 11

Related Questions