Moving away from passwords to SSH etc

Hi there - I’m using TortoiseGit (on Windows) to access some personal git repos hosted at github. Up until now, I’ve been able to push to my repos via a user name and password - but it seems that in future I’ll either need to use SSH or a personal access token. I have an SSH key (.pub file) that I use for a different site and it came with a Putty key (.ppk file) that I need for my local TortoiseGit client. So earlier today, I logged into my github account and successfully registered the .pub file.

IIUC I now need to add the Putty key to my local TortoiseGit project (which I’ve done under TortoiseGit’s Setting). But when I try to push to that particular repo, I’m still getting asked for a user name and password which (I assumed) I wouldn’t need any more… Is there something else I need to do? e.g. set up each repo so that it’ll know to use SSH access future, rather than continuing to ask for my user name and password?

The remote URL for the repository decides whether SSH or HTTPS is used, so you need to change that, too. On the command like the command for that is as follows (assuming origin is the remote for GitHub), not sure how to change it in TortoiseGit.

git remote set-url origin git@github.com:user/repo.git

Ah… that makes sense - I’ll try a few repos tomorrow and see how it goes. Many thanks.

1 Like