I have been using BitBucket as my code repository with Visual Studio, but today I'm not able to push code.
I tried to fetch, it opens a window to input the BitBucket credentials (username/email and password), the window closes and VisualStudio gives an error:
Fetching from origin Error encountered while fetching: 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 'https://[email protected]': terminal prompts disabled
I tried the following but the error continues:
Update the Visual Studio
Installing the BitBucket extension for Visual Studio
Clearing and inserting the git credentials manually
Git Askpass for Windows (Askpass) provides secure Git credential storage for Windows. Askpass provides multi-factor authentication support for Azure DevOps, Team Foundation Server, and GitHub.
Git Credential Manager simplifies authentication with your Azure Repos Git repositories. Credential managers let you use the same credentials that you use for the Azure DevOps Services web portal. Credential managers support multi-factor authentication through Microsoft account or Azure Active Directory (Azure AD).
After trying different solutions for a while I found the solution in the VisualStudio forums: https://developercommunity.visualstudio.com/solutions/310409/view.html
Thanks to James Mu.
Here are the detailed steps that worked for me:
Install the latest pre-release of Git Credential Manager for Windows. You can download the .exe here: https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.16.3
Open the folder C:\Program Files\Git\mingw64\libexec\git-core
with the windows file explorer, order files by "Date modified" descending (most recent first), and copy the top 6 files to %DevEnvDir%\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\libexec\git-core
.
For me the folder is C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\libexec\git-core
.
If it is not for you, view the value of %DevEnvDir% with "Developer Command Prompt for VS 2017" and the "set" command.
Replace the files in the destination folder.
If you are still getting this error for Visual Studio 2019 and updating GCM is not working then please use app password instead of your regular BitBucket login password as of Mar 1 2022, BitBucket stopped using regular password for API based authentication. See reference
https://community.atlassian.com/t5/Bitbucket-articles/Announcement-Bitbucket-Cloud-account-password-usage-for-Git-over/ba-p/1948231
mklink /D "C:\Git" "C:\Program Files\Git"
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