I was trying to do my first push on a new MacBook and got this error after git push
(everything worked well on my old MacBook):
Missing or invalid credentials.
Error: connect ECONNREFUSED /var/folders/tx/53fffl0j51qb47mhnlf8zsdc0000gn/T/vscode-git-1d38026c7f.sock
at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) {
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '/var/folders/tx/53fffl0j51qb47mhnlf8zsdc0000gn/T/vscode-git-1d38026c7f.sock'
}
Missing or invalid credentials.
Error: connect ECONNREFUSED /var/folders/tx/53fffl0j51qb47mhnlf8zsdc0000gn/T/vscode-git-1d38026c7f.sock
at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) {
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '/var/folders/tx/53fffl0j51qb47mhnlf8zsdc0000gn/T/vscode-git-1d38026c7f.sock'
}
remote: No anonymous write access.
fatal: Authentication failed for 'https://github.com/username/repo.git/'
Any idea why and how I can resolve it?
The “fatal: Authentication failed” error message Instead you need to generate a personal access token. This can be done in the application settings of your Github account. Using this token as your password should allow you to push to your remote repository via HTTPS. Use your username as usual.
The “remote: invalid username or password” error informs you that you have incorrectly authenticated to a Git server. To solve this error, make sure that you have used the right username and password and that you are trying to access a Git repository using the correct URL.
It happens if you change your login or password of git service account (Git). You need to change it in Windows Credentials Manager too. type "Credential Manager" in Windows Search menu open it. Windows Credentials Manager->Windows Credential and under Generic Credentials edit your git password.
You are trying to use git from a terminal in vscode. The problem comes from the authentication handler of vscode. To solve the problem:
You have to re-open the terminal to make it work.
As of March 2022, the menus have changed a bit. Here's an illustration of how to access them:
If you're on linux, just add sudo
before the command. Otherwise, you have to add administration prefix to the command.
As mentioned in marpo-it's answer, the setting git.terminalAuthentication
can be unchecked (since VSCode 1.45)
That will avoid that, for Git commands invoked in the Integrated Terminal, like git push
for instance, you would automatically be authenticated against your GitHub account.
Original answer:
I have set up credentials by using git config user.name "your username" and git config user.password "your password", and could see these by running
git config --list
, what am I missing here?
Those are not "credentials": they won't help authenticate you to a remote service like GitHub.
For HTTPS URLS (https://github.com/<me>/<myRepo>
), you would need to:
git config --global credential.helper osxkeychain
)There you would enter your actual credentials:
But if the issue disappear today, then this was linked to this GitHub incident.
Andreas L also mentions in the comments that trying to authenticate from an integrated VS Code terminal can be tricky.
As detailed in "git push origin master
Missing or invalid credentials", and here:
If you work with the JSON-settings file, insert the following line into it:
git.terminalAuthentication: false,
Reloading the VSCode window (shift-control-P to open the Command Palette then find Developer: Reload Window
and press Enter) fixed this for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With