lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

How does lazygit work with ssh keys in windows?

Open RollsChris opened this issue 2 years ago • 4 comments

I'm wondering how lazygit works with ssh keys on windows. I thought it just calls git commands under the hood.

When I'm in a power-shell session and i use git directly, it asks for my ssh key password and everything works. But then inside lazygit (started in the same session) i am getting access denied?

Anyone have any ideas or extra info that could help?

Thanks

RollsChris avatar Nov 30 '23 13:11 RollsChris

I am also having this issue. Any help would be appreciated. Maybe there is a way to give lazygit your ssh key?

wjeffreys96 avatar May 27 '24 20:05 wjeffreys96

Having the same issue, any guidance?

kostja-me avatar Jun 26 '24 09:06 kostja-me

having this issue too. i currently have to use windows and this is such a pain. never had this issue in linux.

ingenarel avatar Sep 06 '24 18:09 ingenarel

okay i was having issues with git submodules in windows and i decided to research a bit more. this might be a problem with git itself.

https://github.com/git-for-windows/git/issues/1613#issuecomment-962240162

using this workaround for the submodules seems to fix the issue for lazygit too.

ingenarel avatar Sep 06 '24 19:09 ingenarel

Same issue here. On Windows Just git pull works fine in powershell. But lazygit doesn't work. Works fine on macOS with the same keys though.

Image

VladasZ avatar Mar 23 '25 13:03 VladasZ

It is possible that is the same type of problem we had with GPG keys. Getting user input down into git commands is unfortunately tricky to handle. See https://github.com/jesseduffield/lazygit/pull/4394 for some usage of WithGpgHandling which does work to temporarily put lazygit in the background to give GPG access to your terminal, in case it needs user input.

ChrisMcD1 avatar Mar 25 '25 00:03 ChrisMcD1

Same Problem for me with a ed25519 ssh-key

Nico-Mayer avatar Apr 02 '25 09:04 Nico-Mayer

Same issue here. On Windows Just git pull works fine in powershell. But lazygit doesn't work. Works fine on macOS with the same keys though.

Image

I got a solution from hashimaziz1 using git config --global core.sshCommand "C:/Windows/System32/OpenSSH/ssh.exe" on windows.

dfkuro avatar Jul 13 '25 05:07 dfkuro