10

I am getting an error in my VS 2017 Team Explorer whenever I pull/fetch or push.

Git failed with a fatal error.
HttpRequestException encountered.
   An error occurred while sending the request.
cannot spawn /C/Program Files/Git/mingw64/libexec/git-core/git-askpass.exe: No error
could not read Password for 'https://<myusername>@bitbucket.org': terminal prompts disabled.

I tried to set my password by indicating:

https://<myusername>:<mypassword>@bitbucket.org

Still not fixed. But when I used SourceTree, it is fine.

How can I fix this so I can able to use VS Team Explorer again for pull/push?

I am using the following:

  • VS 2017 Community 15.7.6
  • Git version 2.18.0
  • Bitbucket

Thanks in advance.

Jeric Cruz
  • 1,899
  • 1
  • 14
  • 29
  • Possible duplicate of [Extension for Visual studio unknown error - unable to push or fetch anything](https://stackoverflow.com/questions/51725278/extension-for-visual-studio-unknown-error-unable-to-push-or-fetch-anything) – Moon Aug 08 '18 at 07:48

4 Answers4

10

Same here, I do believe it's from bitbucket side.

the following worked for us :

Remove git related Credentials stored in Windows Credentials in >>Control Panel\All Control Panel Items\Credential Manager

link to SO here

then use this command :

git remote set-url origin https://name:password@bitbucket.org/repo.git

here is the source for this one

dafriskymonkey
  • 2,189
  • 6
  • 25
  • 48
5

There is a problem in Git for Windows and Microsoft is monitoring the solution to release a new version of VS with the patch.

https://developercommunity.visualstudio.com/content/problem/266473/sync-commit-git-failed-with-a-fatal-error.html

----- Finally I resolved with these steps --------------

1) delete credentials in the Credential Manager

2) rename or delete the Git directory in "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer"

3) install the package "https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.17.0"

4) when VS asks for the BitBucket credential insert them

Only these sequence worked for me.

robob
  • 1,739
  • 4
  • 26
  • 44
  • This did not work for me but modifying step 2 fixed it: rename or delete the Git directory in "C:\Program Files (x86)\Microsoft Visual Studio\2017{Community|Professional|Enterprise}\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git" – Franklin Aug 08 '18 at 19:26
  • When I deleted the "Team Explorer" directory I had to do a VS repair to get team explorer back. and I was still broken. When I deleted the "Git" directory it solved the problem – Franklin Aug 10 '18 at 14:23
2

Bitbucket's Authenticator is currenty failing. There is an open issue about it. https://bitbucket.org/site/master/issues/16892/cannot-fetch-or-push-using-visual-studio

If you can take the risk of pure username:password format using for temporarily, it will solve the problem.

Ongun23
  • 59
  • 2
  • 8
1

I solved by using git-credential-store for now. I think it might be the best way at this moment. As I mention in this link here.

This is link here is how to use git-credential-store. If you want to have "git credential store" globally. You may use below command:

git config --global credential.helper

In fact, you save your username and password in your local. It will ask your username and password only one time.

Otherwise, you can use SSH (it does not work on my VPN).

Gaoxin Huang
  • 178
  • 1
  • 2
  • 9