Bitbucket、Windows 和“致命:无法读取密码”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20923193/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 11:13:49  来源:igfitidea点击:

Bitbucket, Windows and "fatal: could not read Password for"

windowsgitbitbucket

提问by sunpietro

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

我最近重新安装了 Windows,但从存储库下载文件时遇到问题。

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

我已经安装了 GIT 和 Python,但是当我尝试从 Bitbucket 下载任何东西时,我收到消息:

"fatal: could not read Password for: 'https://[email protected]': No such file or directory".

What am I doing wrong?

我究竟做错了什么?

采纳答案by James Pace

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!

一个小时左右前我遇到了同样的问题。我的问题是我试图做一个 git clone 但使用 https url 而不是 ssh 一个。如果您转到您的存储库,您可以从克隆 URL 的下拉列表中选择 ssh 或 https。希望有帮助!

回答by jsarroyo

I solved it setting a global parameter:

我解决了它设置一个全局参数:

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

回答by Yauheni Sivukha

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

尝试在 URL 中包含您的用户名和密码,如下所示:

git clone https://username:[email protected]/path_to/myRepo.git

回答by outofBounds

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.

版本 1.8.5.2 中的 Git 包含一个但使用 bitbucket,将我的 Git 更新到版本 1.9.0 解决了这个问题。

回答by bbarke

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

我只是尝试做同样的事情,但它对我不起作用,而且我最近也在我的机器上重新安装了 Windows。

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

我习惯于使用简单的命令从我的 bitbucket 帐户中签出一个私人仓库 git clone https://[email protected]/username/repo.git,然后系统会提示我为我的用户输入密码。

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.

看起来这可能会在 1.8.5.2 版本中被破坏。我降级到 1.8.4 版,它开始按预期工作。

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

Git下载列表:http: //code.google.com/p/msysgit/downloads/list

Hope this helps!

希望这可以帮助!

回答by PointZeroTwo

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

对于 https 连接,请尝试安装“Git Credential Store”(BitBucket 教程中的“可选”步骤)。

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
  1. http://gitcredentialstore.codeplex.com/下载 git-credential-winstore.exe
  2. 打开 Git Bash Shell,将当前目录更改为 git-credential-winstore.exe 所在的位置
  3. ./git-credential-winstore -i /bin/git

回答by Artyom Pranovich

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

尝试使用git fetch以重新输入和更新过时的密码。

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 failedwhile I was trying to pull changes.

我有类似的问题。由于将实际密码更新为新密码,缓存密码无效。但是 git 没有要求我重新输入有效密码,只是Authentication failed在我尝试提取更改时给了我一个错误。

But magically, git asked me for the actual password when I typed git fetchinstead 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.

但神奇的是,当我输入git fetch而不是提取数据时,git 要求我输入实际密码。一旦我输入了新密码,显然 git 更新了其凭据存储中的旧密码,并且不再询问我输入的密码。

回答by Slav

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

就我而言,问题出.gitconfig在 Windows上的全局文件上。

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

当我尝试在Git BASH 中使用@jsarroyo 提供的解决方案时,我收到一条错误消息,指出该文件不存在。我找不到修复它的方法。.gitconfig.lock

When I completely removed .gitconfig, everything worked fine.

当我完全删除时.gitconfig,一切正常。

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

警告:这样,你会丢失所有的 git 设置,你需要重新配置它。

回答by Martin Staufcik

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.

就我而言,它只是输入到提示对话框中的 bitbucket 密码错误。当我输入正确的密码时,错误消失了。

回答by Eelco van Vliet

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

对我来说,它是通过在设置部分从我的 bitbucket 存储库中获取“私有”开关来解决的