Github wont use public keys

Hi all! I am new to Github!

I deleted my personal access token in favour of using an ssh public key. I added the public key to Github. However now still, when I try to do a fetch my GitBash terminal ( on windows ) asks for my username and password. I expected to get straight in with the public key. I have closed and reopened the terminal. I removed from Windows credentials all references to Github.

So - what am I doing wrong? How do I get Github to use my public key?

The remote URL for your repository decides which protocol (SSH or HTTPS) is used. Naturally you can only use an SSH public key for authentication when using SSH, with HTTPS you have to use username and token.

You can change the URL with the git remote set-url command. You can find the right URL by clicking the green “Code” button on the repository page and selecting SSH.