'Visual Studio Code remote: Invalid username or password fatal: Authentication failed

I'm using Visual Studio code editor issue is it is not asking for password when i run git push origin branchname

remote: Invalid username or password
fatal: Authentication failed for 'https://bitbucket.org/..../.....git/'

but it was working properly before.

I tried these commands also

git config --unset user.password

git config credential.helper ""

now when i try to push code it is giving me following errors :

fatal: credential-cache unavailable; no unix socket support
remote: Invalid username or password
fatal: Authentication failed for 'https://bitbucket.org/..../.....git/'

but from command prompt i'm able to push code. Is there any way i can enable password dialog to appear when i push the code. Thanks



Solution 1:[1]

Make sure you have generated a BitBucket HTTP access token first.
And use that as password.

I would try, from command-line:

git config --global credential.helper manager-core

git ls-remote https://bitbucket.org/..../.....git
# enter your bitbucket username/token
# check it does return the remote branch names

# Then, again:
git ls-remote https://bitbucket.org/..../.....git
# check it does return the remote branch names /without/ asking for your credentials

Once the git ls-remote is working (meaning it does no longer ask for your credentials, which are now successfully cached), close and restart VSCode.
See if the issue persists then.

Solution 2:[2]

Try to set app password for bitbucket, you are trying to use account password as app password which is wrong as per bitbucket April update.

Go to bitbucket -> personal setting page -> app password -> create a app password

Now use this app password to push and pull the code from bitbucket !

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 VonC
Solution 2 SAURABH