I have read Configuring Git over SSH to login once. Muein Muzamil's answer says that to use SSH, we must configure as follows:
remote.origin.url=git@github.com: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 git@github.com protocol whereas a Git Shell does not?
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:
%HOME%
is defined (which git-cmd.bat
or git-bash.vbs do for you),id_rsa(.pub)
private/public ssh keys are in it,id_rsa.pub
public key is published in your GitHub account.