Search code examples
powershellgithubsshgithub-for-windowsgit-shell

Why can the Git Shell use SSH with an HTTP remote origin URL?


I have read Configuring Git over SSH to login once. Muein Muzamil's answer says that to use SSH, we must configure as follows:

[email protected]:your_username/your_project.git

Which is to say, that in a normal Windows PowerShell, SSH does not work with HTTPS.

GitHub for Windows comes with the Git Shell. It's a souped-up PowerShell with some fancy features, including the ability to use SSH with HTTP. I know this because I just ran git push without needing to authenticate, and then ran git config -l to see that I am using HTTPS as the remote origin url.

Why does a normal Windows PowerShell require the [email protected] protocol whereas a Git Shell does not?


Solution

  • Windows PowerShell, SSH does not work with HTTPS

    That doesn't make sense: you are using ssh or you are using https (http with ssl). One "does not work with" the other.

    G4W (GitHub for Windows) has your GitHub account credentials, so it can use an https url.

    A regular Git shell from msysgit/Git for Windows can use https or ssh, BUT for ssh, you need to make sure that: