lazygit: Permission denied (public key) for hosted gitlab

Topic I can’t use SSH to contact a git(lab) repository, but are forced to a https url as remote. In Lazygit i’m unable to fetch or push data, because of authentication problem. Permission denied (public key)

Your thoughts I would expect that at least I’m prompted to enter my passphare for my private key. That isn’t happening, so I assume that this is the reason why it fails. How does lazygit work with HTTPS git repostories? Can someone please help me?

Nice to have feaure: It would also be interesting in lazygit if it caches the password or the decrypted private key as long the process runs.

About this issue

Most upvoted comments

I’m also facing the same issue. But it only happens on Windows, not macOS or Linux.

I found a solution for Windows 10!

Need to:

  1. Install component OpenSSH client (if not installed)
  2. Enable service ssh-agent (Set-Service ssh-agent -StartupType Automatic; Start-Service ssh-agent)
  3. Set up Git to use OpenSSH form Windows (git config --global core.sshcommand "C:/Windows/System32/OpenSSH/ssh.exe)
  4. In each session, add a key to ssh-agent (ssh-add path/to/key)

https://poshsecurity.com/blog/using-the-openssh-client-included-in-windows-10-1809-as-your-gits-ssh-client

Please let me know if I can support you and provide further details.