Git ssh agent running but not saving my username or password

Initial setup

I use Posh-Git and followed Phil Haack's advice for using SSH. That is, I did the following:

  • Install msysgit.
  • Update Posh- Git
  • Add ssh-agent to PATH.

Initial test

Now when I start Powershell ssh-agent starts up. It's good. If I run Get-Proces

I can see this:

 91       8     1728       4208   286     0.23   2520 ssh-agent

      

When it starts, it doesn't ask me for my username and password. This is not good.

Also, during one PowerShell session, git asks me repeatedly for my username and password and never remembers it.

Finding my SSH keys

My SSH keys are located in C:\Users\<my-user>\.ssh

where I see two files:

github_rsa
github_rsa.pub

      

I went ahead and ran ssh-add "C:\Users\<my-user>\.ssh\github_rsa"

.

However, the agent does not remember my credentials.

Testing with git shell

msysgit comes with a git shell, and when I run it, it just authenticates perfectly. I have never asked for a username and password at all.

I reviewed the answer here Configuring git over SSH to login once , which recommends checking if we are using https or ssh protocol.

git config -l

      

In my git shell and my usual Windows PowerShell prompt, all repositories are using HTTPS.

+3


source to share


1 answer


The answer is here: Configuring Git over SSH to login once

git config -l

      



Then run following command if you are using HTTPS in remote.origin.url file

git config remote.origin.url git@github.com:your_username/your_project.git

      

0


source







All Articles