hexphp111
hexphp111

Reputation: 421

git push origin master Missing or invalid credentials

Cannot push anymore to origin master, git push origin master, since a few days, I have uninstalled git and Visual Code and reinstalled it but nothing, I'v got same error :

Missing or invalid credentials.
Error: socket hang up
    at connResetException (internal/errors.js:559:14)
    at Socket.socketOnEnd (_http_client.js:433:23)
    at Socket.emit (events.js:208:15)
    at endReadableNT (_stream_readable.js:1168:12)
    at processTicksAndRejections (internal/process/task_queues.js:77:11) {
  code: 'ECONNRESET'
}

I do not understand this behavior, because on my other computer everything works, and no GitHub files are corrupted.

here is my configuration : Ubuntu 18.04.4 LTS

Need some help please !

Upvotes: 12

Views: 24760

Answers (7)

Akanksha Ingle
Akanksha Ingle

Reputation: 41

Solution: This worked for me, use "sudo git push"

➜ sudo git push

Username for 'https://github.com': tempName

Password for 'https://[email protected]':

Note: use personal access token for password.

Here you can check how to create personal access token: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens

Upvotes: 1

Thivya
Thivya

Reputation: 19

[Visual studio pop up for password][1]][1]

You can see the pop up asking for the password for your git account on the visaul studio. [1]: https://i.sstatic.net/R5Ej1.png

Upvotes: -1

Vishnu Sharma
Vishnu Sharma

Reputation: 1383

Just one more things I tried and it worked as previous comment How you can create Personal access tokens Just click on github profile setting => Developer settings => Personal access tokens.

git remote set-url origin https://<username>:<Personal_access_tokens>@github.com/<your github repository name>.git

After that invalid details error will not display.

Upvotes: 1

iceweasel
iceweasel

Reputation: 786

After Reinstallation you need to set your git credentails once again , add VSCode permission to github account.

before pushing to a remote repository from Vscode or git after restarting your computer , you need to set it first by running following command

git remote set-url origin <repo link>

git remote set-url origin https://<your github username>:<your password>@github.com/<your github username>/<your github repository name>.git

If this still dosen't work reloading VSCode and running this again would help.

additionally you can run the commands in git bash to commit and push changes. This works for me every time

Upvotes: 3

Nikhil Tomy
Nikhil Tomy

Reputation: 73

Missing or invalid credentials. Error: socket hang up.

VS code always reset the git password when you close the application. When you try to push, along with this error, there is a popup box in the top asking again the git password. Enter your git password and push again.

Upvotes: 4

asg86260
asg86260

Reputation: 460

I had this error yesterday using the built in terminal in VScode. My issue was that vscode was prompting me for my github username and password at the top of VScode, and not in the terminal. I just didn't see the input field and the auth connection eventually timed out in the terminal.

Upvotes: 45

hexphp111
hexphp111

Reputation: 421

Finally I resolved my problem with gitkraken - With direct authentication.

Upvotes: -1

Related Questions