43

The visual studio stopped sending my commits to the bitbucket and this error appears

Error encountered while cloning the remote repository: Git failed with a fatal error. HttpRequestException encountered. There was an error submitting the request. can not 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 'https: //gustavobedsamarpes@bitbucket.org': terminal prompts disabled The error occurs when I try to clone my repository or commit

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
Gustavo Moraes
  • 677
  • 2
  • 6
  • 7
  • Was the Git plugin previously working without error? Try using Git directly from the command line. If it's broken there too, then we would know that it is not just an IDE problem. – Tim Biegeleisen Aug 09 '18 at 02:02
  • 2
    Try to change repository link format from "https://username@bitbucket.org" to "https://username:password@bitbucket.org". this should work – CodeMind Sep 18 '18 at 04:40
  • Changing the repository link to include your password will work. However, now your password is stored in plain text in your git config file. This is not a good idea. – Don Shrout Feb 09 '19 at 16:28

5 Answers5

93

I had the same issue, I found an answer that worked for me here: https://github.com/github/VisualStudio/issues/949

Below are the steps mentioned to fix: It seems that the bundled Git-Credential-Manager-for-Windows/ in VIsual Studio 2017 is not the latest release. Downloading the latest release and putting it on top of the files in Visual Studio 2017 worked for me.

  1. download the zip file gcmw-v1.17.0.zip from https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.17.0
  2. navigate to C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\libexec\ (or wherever your 'missing' git-askpass.exe resides).
  3. make a copy of the git-core folder and rename it backup or something like that
  4. put the files from the zip file on top of the contents of your new git-core folder and overwrite where prompted
jessehouwing
  • 106,458
  • 22
  • 256
  • 341
Mark Dowell
  • 964
  • 7
  • 3
  • 6
    worked for me using "Professional" for the path `C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\libexec\git-core` – Dan Beaulieu Aug 09 '18 at 13:18
  • 7
    Worked for me with bitbucket.org too, but required an extra step - I had to change the remote settings URL from [https://login@bitbucket.org/myrepo/myproject.git](https://login@bitbucket.org/myrepo/myproject.git) to [https://bitbucket.org/myrepo/myproject.git](https://bitbucket.org/myrepo/myproject.git) – TH Todorov Aug 09 '18 at 14:23
  • This worked for me too, but I also had to do the extra step TH Todorov recommended. – DigiOz Multimedia Aug 11 '18 at 13:39
  • Worked for me with VS 2017 Enterprise for Bitbucket – SpaceOgre Aug 13 '18 at 10:04
  • 9
    Make sure you do the zip an not the .exe. – Demodave Aug 13 '18 at 21:13
  • 3
    Worked for me with Visual Studio 2017 Community for Bitbucket. The Path was `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\libexec\git-core` – palehorse Aug 14 '18 at 15:28
  • Worked for me too. I din't have to do the extra step, however received a prompt to enter my password from bitbucket. Thanks! – My Helper Aug 15 '18 at 02:21
  • If you accidentally deleted the git-core folder the exe will work for you. – divide_byzero Aug 15 '18 at 13:00
  • Worked for me, VS2017 community with bitbucket extension. Had to re-log in in VS2017. – Nicholas Humphrey Aug 19 '18 at 04:00
  • Confirming this is still working with VS 2017 Enterprise ;) Many thanks. – Ivaylo Aug 23 '18 at 06:04
  • Step 3: make a copy of the git-core folder and rename it backup or something like that With rename it does not work - ONLY copy is good approach. – TarmoPikaro Aug 23 '18 at 15:03
  • Worked for me VS 2017 Enterprise. This was the best solution and most clear steps. Basically copy the files from the downloaded zip https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/download/v1.16.3/gcmw-v1.16.3.zip into your gitcore folder C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\libexec\git-core – Nour Lababidi Aug 24 '18 at 12:56
  • 6
    gcmw-v1.17.0.zip is still buggy, new release v1.16.3 solved the problem. v.1.6.3 change log: Fixed an issue with Bitbucket multifactor authentication https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.16.3 – whizzzkey Aug 26 '18 at 07:32
  • Also worked for me with the additional step from TH Todorov – Miguel Febres Aug 27 '18 at 15:54
  • Try to change repository link format from "https://username@bitbucket.org" to "https://username:password@bitbucket.org". this should work – CodeMind Sep 18 '18 at 04:41
  • I made the dumb mistake of upgrading to VS 2017 15.9.3 and darn if the problem didn't come back again! 8-{ Following the steps above fixed it ... again. I'll post this same thing to the GH 949 issue cited above, maybe MS can find some time to get it fixed once and for all. – Sam C Dec 03 '18 at 21:30
  • I discovered that simply grabbing the `AzureDevOps.Authentication.dll` assembly from the [Git Credential Manager for Windows v1.18.2](https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.18.2) zip file and dropping it into the `C:\Program Files (x86)\Microsoft Visual Studio\2017\<<>>\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\libexec\git-core` folder allowed me to clone a Dev.Azure.com repo. – Sam C Dec 03 '18 at 22:05
  • This did not work for me. Ecd's solution works and bypasses the password prompt. – Steve Scott Jan 28 '19 at 05:24
  • AS of 2/23/19 this worked for me. I was trying to push into my org's private repo and kept getting this problem. I am running VS 2017 15.9 (should have been fixed) and put GCMW.1.18 in the folder specified. It worked. – JDBennett Feb 23 '19 at 20:38
  • Can you update your answer to include this info? Overwriting files in the Visual Studio install can nave negative future effects: https://stackoverflow.com/a/54783935/736079 – jessehouwing May 22 '19 at 14:36
8

I just experienced it this instant. so what i did is i tried to login to bitbucket, surpisingly it says "I cant login to using username please use email". then i did login using my email,then dig my bitbucket settings and found out that i can generate a password..

  1. Goto settings
  2. App password
  3. Create app password
  4. use the password to login instead of your real password

enter image description here

Joebet Mutia
  • 866
  • 7
  • 4
7

A better solution.

After chatting with Chad Boles (who maintains Team Explorer in Visual Studio), we worked out another option. This is preferred over overwriting the files in the Visual Studio installation as this may break future updates and can cause hard to debug issues in the future.

The trick is, until Visual Studio actually ships with Git credential Manager for Windows 1.18.4 or newer (it should after Visual Studio 2019 preview 4.0 or newer), to configure the specific installation location of the Git credential manager in your Git Global Config:

  1. Install the latest version of GCMW-1.xx.x.exe in your system and/or update to the latest version of Git for Windows which should include GCM.
  2. Update your global git config to point to a specific implementation of the Git credential Manager:

    c:\>git config --global --edit
    

    Update the [credential] section to read:

    [credential]
        helper = C:\\\\Program\\ Files\\\\Git\\\\mingw64\\\\libexec\\\\git-core\\\\git-credential-manager.exe
    

    Ensure the path points to where the latest Git Credential Manager can be found on your system. Mind all of the escapes needed to make paths work in the global git config.

An alternative that doesn't require config changes

Another option is to install the latest version of Git for Windows (which already ships with the Git credential Manager for Windows 1.18.4) and perform the initial clone and authentication from the command line. This will store the credentials in the Windows Credential Store, after which Visual Studio will happily pick them up.

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
  • 1
    thanks! installing the latest GCM and GFW windows helped. Inorder to fix the actual issue though, I had to re-clone my repo into a new folder to fix the credentials issue. – samneric Apr 16 '20 at 18:27
  • 1
    That may have been the remote-url having something wrong to it. – jessehouwing Apr 16 '20 at 20:19
  • I think you are right - looking back I think it is a delayed issue from when MS renamed the repo from vsts* to dev.azure.com – samneric Apr 16 '20 at 21:33
1

In addition to Ecd's answer (can't comment yet), when your password contains '@' sign (or any symbols used in url), you need to escape that character as it will result to 'Could not resolve host' by url encoding. %40 for the case of '@' sign.

ricsierics
  • 181
  • 4
  • 10
1

I just solved this same issue for myself in Visual Studio 2019.

In Tools -> Nuget Package Manager -> Package Manager Console

This command will update the GitForWindows version (as well as the Git Credentials manager) for you.

Install-Package GitForWindows -Version 2.23.0

Reference: https://www.nuget.org/packages/GitForWindows/

CloudEmber
  • 99
  • 4