comment 0

GitHub on Windows: Switching git remote from HTTP to the git protocol to avoid password request on push

If you are using Github under Windows, without the Github client, this tip can help you avoid password requests on pull and push.

This occurs with both TortoiseGit and Git bash. When you do a git pull , no password is requested if it is a public repository. If it is a private one, or when you will want to push your local changes, a password dialog keeps appearing, even if you have setup your private key properly.

As a reminder, here is the trick to use SSH key in TortoiseGit to avoid entering password each time to want to push:

  • use puttygen to create a pair or private a public SSH keys
  • backup your private key
  • Setup the public key in GitHub SSH Key account settings
  • Configure the private key in the TortoiseGIT remote settings:

TortoiseGIT > Settings > Git > Remote > “origin” >  Putty key

However, for some unknown reason, that does not work, password keeps being asked when you do git pull .

Let’s imagine you have this “ origin ” repository in your git remote :

If you are under Windows, you noticed that the password is always requested even if you have entered a valid SSH key.

That’s because you use the HTTP protocol. You have to use the GIT protocol to allow fully seamless git push.

Simply follow these rules:

  • remove http://whateverbefore  in  and replace by  git
  • replace the first /  by  :

The remote should now look like:

That’s all ! No password ever requested !

Filed under: Git