Zaldimmar
Zaldimmar

Reputation: 373

Can't push git, visual studio. Git failed with a fatal error. fatal: HttpRequestException encountered

Here is my error on visual studio. I can't figure out if there is a config to fix this. Additionally I am restricted from installing git command line tools.

Error encountered while pushing to the remote repository: Git failed with a fatal error.
fatal: HttpRequestException encountered.
   An error occurred while sending the request.
error: cannot spawn askpass: No such file or directory
fatal: could not read Username for 'https://github.com': terminal prompts disabled

Upvotes: 37

Views: 35291

Answers (10)

Dinesh Youngmaster
Dinesh Youngmaster

Reputation: 3

open your project folder path, right-click on the folder, select Git Bash, in that type the command

git config --global http.sslVerify false

git command

Then try to Sync, fetch and pull, it will work

Upvotes: 0

Daniel
Daniel

Reputation: 11

You code written above is right, but if you can pull and can't push, but you can push just in console and not in VS, and you are behind a corporate proxy, then you might try another approach. It may work for you:

  1. Create GitHub token: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line#creating-a-token
  2. In the .gitconfig file write:

    [credential] 
    authority = *the-token*"
    
  3. Search for the file .gitconfig by command: git config --list --show-origin

Upvotes: 1

lymberazo
lymberazo

Reputation: 513

In my case the above didn't work since my google email address for bitbucket had 2 factor authentication. So I had to create a bitbucket app token and in the origin https url I had to put the token that was generated like so https://username:[email protected]/repo/test.git

Upvotes: 1

Prabhanjan Naib
Prabhanjan Naib

Reputation: 201

Git bash on windows was giving trouble even after typing in the password in the pop up window. I tried with Git Gui and it works fine.

Upvotes: 0

smoore4
smoore4

Reputation: 4866

Git Credential Manager for Windows v1.17.1 fixes the issue on BitBucket. Note the one comment:

Bug Fixes:

Fixes a bug related to Bitbucket authentication (thanks to @Foda for contributing the fixes).

https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases

Upvotes: 3

tyrantqiao
tyrantqiao

Reputation: 339

In my case, updating git and copying the bin directory cannot fix the error. My solution is checking your git config. First, open git bash. Second, check git config. git config -l The http.proxy and https.proxy would make you cannot update the project successfully. And if you use vpn, and make the 1080 port open, that would make the upload not so smoothly.(Only the case that your vpn is slow)

Upvotes: 1

Nz_z
Nz_z

Reputation: 21

This is because Github disabled TLS v1.0 and v1.1,you can read the notice on Github Engineering, here is the link Weak cryptographic standards removal notice.

From the linked page:

Last year we announced the deprecation of several weak cryptographic standards. Then we provided a status update toward the end of last year outlining some changes we’d made to make the transition easier for clients. We quickly approached the February 1, 2018 cutoff date we mentioned in previous posts and, as a result, pushed back our schedule by one week.

...

Visual Studio ships with specific versions of Git for Windows and the Git Credential Manager for Windows (GCM). Microsoft has updated the latest versions of Visual Studio 2017 to work with TLSv1.2 Git servers. We advise users of Visual Studio to upgrade to the latest release by clicking on the in-product notification flag or by checking for an update directly from the IDE. Microsoft has provided additional guidance on the Visual Studio developer community support forum.

Upvotes: 2

Lachezar Lalov
Lachezar Lalov

Reputation: 517

Simply update your Visual Studio to the latest version and this should be fixed. Worked for me.

Upvotes: 32

Daedalon
Daedalon

Reputation: 590

Cause: GitHub updated their security requirements on the server side. They no longer support TLS 1.0 and 1.1, only 1.2. Older Git Credential Manager for Windows versions used 1.0.

Solution: Update Git for Windows. Version 2.14.3 and newer include an up-to-date Git Credential Manager for Windows.

Alternatively you can update only the Git Credential Manager for Windows itself. It supports TLS 1.2 from version 1.14.0 onwards.

Upvotes: 32

Somenath Maji
Somenath Maji

Reputation: 51

Check if you have proper configuration. It might be possible if all are okay, there is a wrong email. Inside Team explorer check Global Settings for email.

Upvotes: 1

Related Questions