Git Does Not Use SSH Key (Windows)

- 1 answer

I created a SSH key for my GitLab repository and when I test it with SSH it does work and asks for the passphrase:

>ssh -T [email protected]
Enter passphrase for key 'C:\Users\[username]/.ssh/id_ed25519':
Welcome to GitLab, @000[...]!

I also used

>git remote set-url origin [email protected]:000[...]/project.git

without errors. However, when I try to commit and push to the repository, then Git asks for the Password of [email protected] and not for the passphrase of the SSH key.

According to the Docs (, you can set the ssh key in the config file ~/.ssh/config. So I created a text file in this directory with this content:

 IdentityFile ~/.ssh/id_ed25519

It still does not work and I am not sure if it even uses this config file. I was able to get everything running on a Linux server but not on this Windows computer. I tried it via command line and via Pycharm.

>git --version
git version 


You can customize the ssh command used by git in the git config and then pass your key when using any git command.

git config core.sshCommand "ssh -i ~/.ssh/id_ed25519"