"fatal: Authentication failed for" when pushing to GitHub from Visual Studio Code (1.62.2)

Viewed 19859

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?

7 Answers

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

I faced this problem.... TO fix it, you should simply follow these steps:

  1. Go to your github profile settings
  2. Select Developer section and go to Personal Access token
  3. Create a new acces Token ( Copy it as soon as it has been generated )
  4. Then try to push some changes in your repository, you will be asked to put username and password
  5. For the password, just paste the access token you just copied

Happy Coding

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 FilePreferencesSettingsUserExtensionsGitTerminal Authentication).

Enter image description here

Adding username and password (personal token provided by GitHub) to remote URL, resolved the issue to me.

  1. check connected remote URL:

git remote -v

  1. set remote URL with credentials:

git remote set-url origin https://username:password@github.com/organization/repo.git

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.

If you are windows. And you changed the password of the git credential recently. You may see the error in the next git action or new clone.

  1. Go to Control Panel -> All Control Panel Items -> Credential Manager
  2. Go to Windows Credentials.
  3. Find the existing GIT URL git:https://xxxxx under Generic Credentials.
  4. Edit the credential, and enter new password. Then try your actions again.

I changed my machine's password and faced the same issue in VS Code (on Windows). I fixed it by updating password in Credential Manager of Control Panel.

enter image description here

Then click on the notch shown in rectangular highlight. It'll show a small window where you can edit the credentials. Once done, hit Save button.

Ola!

Related