I have an error when I try to push anything to my bitbucket repository via Git extension for visual studio:
Error encountered while pushing branch to the remote repository: Git failed with a fatal error.
HttpRequestException encountered.
An error occurred while sending the request.
cannot spawn /C/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/Git/mingw32/libexec/git-core/git-askpass.exe: No such file or directory
could not read Password for ......
What could be the issue here?
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/Git"
3) install the package "https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.17.0"
4) when VS ask for the BitBucket / GitHub credential insert them
Reason: The same error message was when GitHub deprecated support for TLS1.0 and TLS1.1 some months ago. And now it looks like Atlassian made some changes to BitBucket's networking on 06-Aug-18 (https://blog.bitbucket.org/2018/08/06/update-ip-migration/). This change could be related to the problem.
Workaround: The bundled Git-Credential-Manager-for-Windows in Visual Studio 2017 is not of the latest release yet. Downloading the latest release and putting it on top of the files in Visual Studio 2017 fix the issue:
Also seems you need to remove "login" from remote settings if such is configured (i.e change https://[email protected]/myrepo/myproject.git to https://bitbucket.org/myrepo/myproject.git) and use Atlassian ID with full email instead.
(source)
It seems to affect some Visual Studio users since a few hours ago, even with no changes taken place in the environment prior to that. Something apparently went wrong in Git integration with Visual Studio.
There is currently a workaround, where you set the password in the remotes settings of the repository, as shown here, but note that it is insecure as it requires storing the password in plain text.
Another workaround is to work with Git using command line.
A third workaround, which I also find the best one, is to configure SSH key authentication. As of now, it seems to work with Visual Studio 2017 without any issues. This is the solution I chose.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With