Visual studio 2017 with bitbucket, terminal prompts disabled

做~自己de王妃 提交于 2019-11-27 00:27:00

问题


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


回答1:


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



回答2:


I have added my password to remote URL. (Team Explorer > Repository Settings > Remotes) https://username:password@bitbucket.org/username/myproject.git. After that my problem has solved.




回答3:


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.




回答4:


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.




回答5:


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




回答6:


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/



来源:https://stackoverflow.com/questions/51757837/visual-studio-2017-with-bitbucket-terminal-prompts-disabled

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!