I had this problem after upgrading to MacOS Big Sur. Some of the options from VonC's answer worked for me, but in a slightly different combination. These were my steps to finally get VS Code working together with GitHub again:
1. (Re-)install ssh-askpass & start ssh-pass service
As the docs state::
brew install theseal/ssh-askpass/ssh-askpass
Or if you already had it installed (like me), then re-install:
brew reinstall theseal/ssh-askpass/ssh-askpass
Finally start the ssh-askpass
service to load the SSH_ASKPASS environment variable via:
brew services start ssh-askpass
2. Prepare to create symbolic link to ssh-askpass (aka install xQuartz)
I simply wanted to create a symbolic link from /usr/local/bin/ssh-askpass
to /usr/X11R6/bin/ssh-askpass
. But I realized that in MacOS Big Sur the file /usr/X11R6
itself is a link to /private/var/select/X11
and that inside /private/var/select
the X11
is simply gone. Trying to access it I got a cd: no such file or directory: /private/var/select/X11
.
This can be fixed by installing the latest version of XQuartz from https://www.xquartz.org. Download the XQuartz-2.x.x.dmg
, open it and follow the installation steps. Afterwards the folder /private/var/select/X11
is present again :)
3. Create symbolic link to ssh-askpass
Now we'll be able to create the symbolic link:
sudo ln -s /usr/local/bin/ssh-askpass /usr/X11R6/bin/ssh-askpass
4. Allow VS Code to access Systems Events in MacOS System Preferences
Using the GitHub integration in VSCode will only work, as we allow it to access System Events.app which itself is needed to interact with ssh-askpass
. This can be configured in the MacOS System Preferences / Security & Privacy windows inside the Privacy tab. You may need to scroll down to the Automation
point and check the box for Code
(sorry I have only a German MacOS here):

5. Re-Start or even Re-Install VSCode
For me only re-starting VS Code didn't fix the problem. After having done all the steps mentioned above another error with ssh-askpass
made it into my VS Code log: /usr/local/bin/ssh-askpass:2141:2142: execution error: „System Events“ error connection invalid (-2700)
As I also used homebrew to install VSCode I simply ran
brew reinstall visual-studio-code
to re-install it. Finally the GitHub integration worked again for me.
6. (Optional, only if your ssh key has a passphrase) Add your ssh key's passphrase to the MacOS keychain
If you created a ssh key which is secured by a passphrase, VS Code might ask you for that passphrase every time you use the Git integration (which was the case for me). If you don't want to type the passphrase every time, there was also a hint by VonC in the comments of his answer: you need to add the key's passphrase to the MacOS keychain (which is described in the GitHub docs).
Here is a brief summary what you need to do:
6.1 Enhance your ~/.ssh/config
Add the 3 lines to your ~/.ssh/config
using your ssh key's name:
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/your_key_file_name_here
6.2 Add your passphrase to the MacOS keychain
Run the ssh-add
command using the -K
parameter:
ssh-add -K ~/.ssh/your_key_file_name_here
Now your VS Code should stop asking for your key's passphrase!