"fatal: Authentication failed for" when pushing to GitHub from Visual Studio Code (1.62.2)
A lot of us are currently having the issue where we aren't able to push changes to GitHub anymore and getting a
fatal: Authentication failed for
error. This has been observed on Linux.
This is because the newest version of Visual Studio Code (1.62.2) introduced this bug.
Is there a fix for this version, or otherwise a workaround?
Solution 1:
The way I solved it was by downgrading it to 1.62.1, and now it works perfectly again.
I'm on Linux, so this may not apply or work for you, but it should if all Visual Studio Code versions are the same across all OSes.
The Visual Studio Code team has confirmed that it will be fixed on 1.62.3
If you use openSUSE Tumbleweed like me, you can run the following command in the terminal to downgrade:
$ sudo zypper install --oldpackage code-1.62.1
Solution 2:
It is apparently covered by this issue, to be solved in 1.62.3.
The workaround is to unset Git: Terminal Authentication in the Visual Studio Code settings (menu File → Preferences → Settings → User → Extensions → Git → Terminal Authentication).
Solution 3:
This post here solved my issue.
I had temporarily been using git config --global credential.helper cache
and pushing commits in the regular Linux shell using a personal access token.
After entering and caching in the regular Linux shell, I've so far been able to push commits per usual in Visual Studio Code's terminal.
UPDATE:
Tried Git store with the command $ git config credential.helper store
and Im now able to push to my repo no problem without having to input the PAT with every push. Cache only works temporarily. Also found a pretty in-depth post here that explains the process of storing github PATs for mac, windows and linux more in depth. However, it's an old post.