gitui
                                
                                 gitui copied to clipboard
                                
                                    gitui copied to clipboard
                            
                            
                            
                        How to push using ssh key?
Describe the bug
I use mostly ssh key to push and when using gitui to push it jusr error out with git error:Couldn't find credentials 
To Reproduce Steps to reproduce the behavior:
- Install gitui with homebrew
- Open gitui
- Type p to push
- See error
Expected behavior It should just use the configured ssh key from ssh-agent
Screenshots If applicable, add screenshots to help explain your problem.
Context (please complete the following information):
- macOS Montery 12.1
- GitUI Version 0.21.0
Additional context Add any other context about the problem here.
I have the same problem, wondering if there is something to configure for that? I didn't find any option to link my existing SSH key...
I can confirm on
- macOS Ventura 13.0.1 (M1)
- gitui 0.21.0
Is this possibly connected to the "Bad Credentials" problem mentioned in the FAQ? I'm using vanilla ssh public key authentication w/o ssh-agent.
An earlier bug report was asking for an offending URL. I can't share mine either (private machine), but the schema follows the below pattern:
ssh://my.machine.de:/~/git/projects/project.git
Another one, i think there should be an option to define ssh keys path
problem is actual
I'm using a custom SSH key for the failing repo, meaning that in ~/.ssh/config a specific key path is defined for that host via IdentityFile.
Gitui doesn't respect that (I guess you just ship ssh and use the git config). So this fails with git error:Bad credentials..
Doesn't look like you can tell git itself to use a specific key.
At least git config core.sshCommand 'ssh -i private_key_file -o IdentitiesOnly=yes' doesn't seem to work. git push origin by itself works.
same problem too @extrawurst
I'm using a custom SSH key for the failing repo, meaning that in ~/.ssh/config a specific key path is defined for that host via
IdentityFile. Gitui doesn't respect that (I guess you just ship ssh and use the git config). So this fails withgit error:Bad credentials.. Doesn't look like you can tell git itself to use a specific key. At leastgit config core.sshCommand 'ssh -i private_key_file -o IdentitiesOnly=yes'doesn't seem to work.git push originby itself works.
I got this response on Discord a while back:
The underlying issue is that libssh2 itself doesn't care about ~/.ssh/config. It has been a source of complaint for many users who were bitten by this, and I myself find it unfortunate, too. But we certainly do not want to implement support for parsing the SSH configuration ourselves, and I think implementing just a subset of it that is not even applied via ~/.ssh/config is not really worth it.
Not sure what state this is in today, but it seems that it's still the issue.
Stuck with the same problem. The only option I found is to use ssh-agent as a key provider. This, unfortunately, requires changing the workflow when working with multiple identities. Removing all the keys with ssh-add -D and then adding only a project-specific key to agent with ssh-add ./ssh/current_project_key solves the problem for me.
P.S. If anybody knows the way to automate key selection for ssh-agent depending on current environment, please let me know. But it seems to me this requires creating bash/zsh/nvim plugin
https://github.com/libgit2/libgit2/pull/6617 - soon supported by upstream
The upstream has added OpenSSH support, any updates here?
Same problem here. Any fix in sigth?
same problem. any news?
Once there are any updates they happen here first :)