gitsshnushell

Git under nushell not using added ssh-key


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?


Solution

  • Short Version

    git config --global core.sshcommand "C:/Windows/System32/OpenSSH/ssh.exe"
    

    More Detail

    I was able to reproduce this. It seems that, by default under Nushell:

    Since the Git-bash /usr/bin/ssh-agent isn'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:

    git config --global core.sshcommand "C:/Windows/System32/OpenSSH/ssh.exe"
    

    After I did that, git under Nushell used my ID to access private GitHub repos.