1

I have added ssh key to my git repo through below command and now getting below error:

CMD git config --global url.ssh://git@github.com/.insteadOf https://github.com/

 Error : User1’s-MacBook-Pro:untitled folder ndpiparava$ git clone  https://github.com/XXX-Asft/XXXX
Cloning into 'XXXXX'...
Permission denied (publickey).
fatal: Could not read from remote repository.

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

I have realised that I have made mistake by setting up ssh instead of Https.
Is there any way that I can remove my ip from ssh list for my remote git and start using https?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Nitin
  • 7,455
  • 2
  • 32
  • 51

1 Answers1

1

git config --global url.ssh://git@github.com/.insteadOf https://github.com/

This means any url starting with https://github.com/ will be rewritten with ssh://git@github.com/.

There is no "ip from ssh list for my remote git" to remove.

You can simply delete that global config setting.

git config --global --unset url.ssh://git@github.com/.insteadOf

And you can remove your public key you set on your GitHub account.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250