Solving ‘git:push’ Missing or invalid credentials.

Anna Ikoki
2 min readJan 31, 2022

Error: connect ECONNREFUSED

While using vscode terminal, I push my work to github, and encountered the ‘missing credentials error refusing to connect’

Error with git push command

This is what I am doing to debug:

Solution 1: I first unchecked the git-auth from VsCode settings-git: Terminal Auth and settings-github: Git Auth

After unchecking, the error was still there.

Solution 2: I use sudo git push

It prompts to use PAT (Personal Access Token). Here is how to create one.

It works after following the steps in the above link. Token will expire after some set period of time. It is also long to type and you must copy paste it.

➜ sudo git push
Username for 'https://github.com': LujiAnna
Password for 'https://LujiAnna@github.com':

Next, I will need to use SSH, or to cache the PAT, so I don’t have to use credentials every time I git push

  • Citation: Stackoverflow & github docs

--

--