-1

Might be an odd case as I initially cloned a repo using https inside EC2. Now I have setup ssh for the EC2 instance to connect to github (creating a ssh key pair inside EC2 and added the public key to github). I have tested the ssh connection and it works as I can clone repos from my github account inside the EC2 instance.

But how to use ssh to do git pull from the repo that I initially cloned using https? For this repo, if I do git pull it still uses https asking for my username and an access token.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
dragonfly02
  • 3,403
  • 32
  • 55
  • 2
    Does this answer your question? [How to change a connection to GitHub from SSH to HTTPS?](https://stackoverflow.com/questions/30683399/how-to-change-a-connection-to-github-from-ssh-to-https). I realize that you want to do the opposite, but I think the basic procedure is the same either way. – CryptoFool Oct 12 '22 at 05:46

1 Answers1

1

Try this:

cd <your-git-directory>
git remote set-url origin <git-ssh-url>

Article on this here