Bitbucket, Windows and “fatal: could not read Password for”

做~自己de王妃 提交于 2019-12-18 10:08:51

问题


I recently reinstalled Windows and I have a problem with downloading files from repository.

I have installed GIT and Python, but when I am trying to download anything from Bitbucket I get the message:

"fatal: could not read Password for: 'https://username@bitbucket.org': No such file or directory".

What am I doing wrong?


回答1:


I had the same problem an hour or so ago. My issue was that I was trying to do a git clone but using the https url instead of the ssh one. If you go to your repository you can select ssh or https from the dropdown for the clone url. Hope that helps!




回答2:


I solved it setting a global parameter:

git config --global core.askpass /usr/libexec/git-core/git-gui--askpass



回答3:


Try to include your username and password in the URL like this:

git clone https://username:password@bitbucket.org/path_to/myRepo.git



回答4:


Just solved this Problem

Git in Version 1.8.5.2 contains a but using bitbucket, updating my Git to Version 1.9.0 solved this problem.




回答5:


I just tried to do the same thing and it did not work for me, and I too recently reinstalled windows on my machine.

I am used to checking out a private repo from my bitbucket account by using the simple command git clone https://username@bitbucket.org/username/repo.git and then being prompted to enter a password for my user.

It looks like this might be broken in version 1.8.5.2. I downgraded to version 1.8.4 and it started working as expected.

Git download list: http://code.google.com/p/msysgit/downloads/list

Hope this helps!




回答6:


For https connections try installing the "Git Credential Store" (an "optional" step in the BitBucket tutorial).

This is how to install it:

  1. Download git-credential-winstore.exe from http://gitcredentialstore.codeplex.com/
  2. Open the Git Bash Shell and change the current directory to where git-credential-winstore.exe is located
  3. Run ./git-credential-winstore -i /bin/git



回答7:


Try to use git fetch in order to reenter and update the outdated password.

I had the similar issue. The cached password become invalid due to updating the actual password to new one. But git didn't ask me for reentering the valid password and just gave me an error that Authentication failed while I was trying to pull changes.

But magically, git asked me for the actual password when I typed git fetch instead of pulling the data. Once I entered the new password, apparently git updated the old one in its credentials storage and no longer asked me about the entering password again.




回答8:


In my case, the problem was with the global file .gitconfig on Windows.

When I tried to use solution provided by @jsarroyo in Git BASH, I got an error saying that the file .gitconfig.lock did not exist. I could find no way to fix it.

When I completely removed .gitconfig, everything worked fine.

WARNING: This way, you lose all your git settings and you need to configure it again.




回答9:


In my case, it was just a wrong password for bitbucket entered into the prompt dialog. When I entered the correct password, the error disappeared.




回答10:


For me it was solved by taking of the 'private' switch from my bitbucket repository in the settings sections




回答11:


I got this issue when I upgraded from Windows 7 to 8 and settings messed up for me too. I had to regenerate private and public keys, and change my TortoiseGIT to use plink, instead of SSH.exe

I wrote step by step instructions at http://techblog.saurabhkumar.com/2015/09/using-tortoisegit-on-windows-with.html



来源:https://stackoverflow.com/questions/20923193/bitbucket-windows-and-fatal-could-not-read-password-for

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