I am using Git from the VS Code terminal on Ubuntu. For some reason, it started to ask me to unlock my SSH key every time I wanted to push/pull. This is usually fixed by configuring the SSH agent, for instance as explained here in the VS Code documentation.

The issue is that none of the usual methods worked for me. After trying countless hacks and tricks, I finally came up with a solution: I just needed to talk to the Gnome Keyring daemon instead of ssh-agent. My setup might be oddly specific, but in case it can save your time, fellow Internet wanderer, here is my workaround.

Just add the following snippet in your .bash_profile or .zshenv (if you are using zsh):

if [ -z "$DESKTOP_SESSION" ];then
    eval $(gnome-keyring-daemon --start)
    export SSH_AUTH_SOCK