Error: 'could not read Username for 'https://github.com' while pushing

Asked

Viewed 349 times

1

I have an ASP.NET versioned project on Github and while trying to do one push the following error is returned:

fatal: could not read Username for 'https://github.com': terminal prompts disabled

Does anyone have any tips?

  • I removed the tag, asp.net because the problem is with GIT or Github, it has nothing to do with the project being ASP.NET.

  • What version of Git?

  • Complete push command is missing

  • There’s no full push command, I’m actually using the github plugin for visual studio, when doing git in hand works normally.

  • So it’s probably the plugin’s configuration, nothing to do with git itself. Read the plugin documentation, about the settings, and see if you stopped doing any steps.

  • It might have something to do with Git... You need to upgrade to the latest version for security reasons. .

Show 1 more comment

1 answer

1

This error occurs when the git need ask the user name and password, but the only mechanism to ask for the user and password is the console and there is no console available.

This usually occurs when you are using some software over the git (in your case, I believe it would be Visual Studio) and have something incorrect or missing set up on the credentials part.

You can solve the problem as follows:

  1. Use the gitcredentials and save user/password in the Git configuration itself.
  2. You can also check how is the user and password if opted for the Windows manager. Like this: Credential Manager -> Windows Credentials -> below Generic Credentials -> update/remove credentials. Example: git:https://xxx.visualstudio.com
  3. Use SSH instead of HTTPS by setting up an SSH key on your machine and placing it in your Github account.
  4. Also there are reports that this error may occur due to problems of the software itself that interfaces with Git (Sourcetree, Visual Studio, etc). Try updating it too.

If you are not using any tool, try use this command on the console and try again to do the push:

env GIT_TERMINAL_PROMPT=1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.