0

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.

1

1 Answer 1

1

Try this:

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

Article on this here

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.