Unable to do a `git commit` without the key being added beforehand
I recently switched to KDE Plasma, but when I was using GNOME, what I'll describe used to work flawlessly:
Currently, I'm not able to just log into my desktop and do a git commit
, for example. This is the error I get:
$ git commit -m 'foo' --allow-empty
error: Couldn't find key in agent?
fatal: failed to write commit object
I understand the error message (I think, lol): I must ssh-add
my key first. Alternatively, I can do a git fetch
and then KSSHAskPass will prompt me for the password and the key is added to the agent. But that's a little annoying/tedious, to be honest.
On GNOME, this was somehow done automatically: On any git operation that needed authentication, the password prompt would always pop up first, so errors like the one I mentioned above never happened to me.
Is it possible to achieve the same with KSSHAskPass (or any other tool, really)? I.e., can I just login, do a git commit
and make KSSHAskPass prompt me for my password?
Thank you!