Skip to content

Signing Git Commits with SSH Key doesn't work with SSH Agent on Windows #4725

Description

@QuAzI

I am trying to use Signing Git Commits with SSH Key
So, I have a working SSH with the ssh-ed25519 key and I've made a few settings

git config --global commit.gpgsign true
git config --global gpg.format ssh
git config --global user.signingkey "ssh-ed25519 <public key id>"

All works fine on WSL, but not on Windows

> git commit --allow-empty --message="Testing SSH from Win"
error: Couldn't get agent socket?

fatal: failed to write commit object

OpenSSH client works with SSH Agent on Windows and on WSL. All keys are present in the agent
WSL just requires a small hack with socat in ~/.bashrc

SSH_AUTH_SOCK=$HOME/.ssh/wsl-ssh-agent.sock
if [ ! -S "$SSH_AUTH_SOCK" ]
then
  export SSH_AUTH_SOCK
  /usr/bin/socat UNIX-LISTEN:"$SSH_AUTH_SOCK",fork EXEC:"$(which npiperelay.exe) -ei -s //./pipe/openssh-ssh-agent",nofork 2>&1 &
fi

But I don't understand what I have to tweak for Git Bash while git can use SSH Agent to pull my commits from private repo

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions