I am having trouble setting up nushell in windows 11 to not always ask me for the password for my ssh-key when I am using git.
I have confirmed that ssh-agent is running used ssh-add to add my key and
ssh-add -l
shows that the correct key is indeed added. But whenever I issue a git command that would require ssh, I am asked for my password again.
Any ideas why this might be the case?
Short Version
More Detail
I was able to reproduce this. It seems that, by default under Nushell:
In my case,
ssh-add(andssh) in Nushell is coming from the Windows OpenSSH implementation. I'm assuming you have the Windows OpenSSH client installed?On the other hand, as far as I can tell,
gitfor Windows seems to default to using the Git-bash provided/usr/bin/ssh. This requires that the environment variables are set properly by/usr/bin/ssh-agent -s(normally eval'd into Bash or other shell). Under Git-Bash:Since the Git-bash
/usr/bin/ssh-agentisn't available under Nushell for Windows, we need to config Git to just use the Windows OpenSSH agent directly. This can be done (reference) via:After I did that,
gitunder Nushell used my ID to access private GitHub repos.