无法再通过 https 推送到 Bitbucket:git 返回致命错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20928681/
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
Cannot push to Bitbucket via https anymore: git returns fatal error
提问by Jabbath
I recently reinstalled windows and got the latest version of git. I created a new repo on Bitbucket and ran
我最近重新安装了 Windows 并获得了最新版本的 git。我在 Bitbucket 上创建了一个新的 repo 并运行
git remote add origin https://[email protected]/MYUSERNAME/test.git
then I ran
然后我跑了
git push -u origin --all
however this gave me the error
但是这给了我错误
fatal: could not read Password for 'https://[email protected]': No such
file or directory
before I would just get a prompt asking me for my username and password, and the push worked fine. I've tried reverting to Git 1.7.11 but this didn't do anything.
在我收到一个提示,询问我的用户名和密码之前,推送工作正常。我试过恢复到 Git 1.7.11 但这没有做任何事情。
采纳答案by Leonardo Brambilla
What I did was to change the protocol from HTTPS to GIT.
我所做的是将协议从 HTTPS 更改为 GIT。
Followed the instructions to setup SSH here: https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git
按照此处的说明设置 SSH:https: //confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git
(easy from the GitBash console, you don't need to install SSH or nothing, all comes with Git)
(从 GitBash 控制台很容易,您不需要安装 SSH 或什么都不安装,一切都随 Git 提供)
After you completed the SSH setup, just re-add the remote with the git@bitbucket.... url and you are done.
完成 SSH 设置后,只需使用 git@bitbucket.... url 重新添加遥控器即可。
Hope this helps.
希望这可以帮助。
I have installed Git version 1.8.5.2-preview20131230
我已经安装了 Git 版本 1.8.5.2-preview20131230
回答by Eidan Spiegel
I solved this by adding my password in the url.
我通过在 url 中添加我的密码解决了这个问题。
Instead of:
代替:
git remote add origin https://[email protected]/MYUSERNAME/test.git
I used:
我用了:
git remote add origin https://MYUSERNAME:[email protected]/MYUSERNAME/test.git
回答by guest
I got this error when updated git to 1.8.5.2. When I rolled git to version 1.7.10 (initial version), the error disappeared.
将 git 更新到 1.8.5.2 时出现此错误。当我将 git 滚动到版本 1.7.10(初始版本)时,错误消失了。
回答by Gabriela Gabriel
As I really needed to use HTTPS instead of SSH (proxy limitations), I've solved it by setting the remote push url
to the HTTPS url as follow:
由于我确实需要使用 HTTPS 而不是 SSH(代理限制),因此我通过将远程设置push url
为 HTTPS url 来解决它,如下所示:
git remote set-url --push origin https://[email protected]/MYUSERNAME/test.git
git remote set-url --push origin https://[email protected]/MYUSERNAME/test.git
git version 1.9.5
版本 1.9.5
回答by Brad
I had the same problem. Installing Git 1.9.0 solved it for me.
我有同样的问题。安装 Git 1.9.0 为我解决了这个问题。
回答by Pascalius
I solved it by adding my ssh key to the repository and using the ssh url
我通过将我的 ssh 密钥添加到存储库并使用 ssh url 解决了它
回答by Peter Skoda
If you experience this issue using GitExtensions then this might help you:
如果您在使用 GitExtensions 时遇到此问题,那么这可能对您有所帮助:
GitExt -> Tools -> Settings -> SSH -> Configure Git credential helper -> Suggest
GitExt -> 工具 -> 设置 -> SSH -> 配置 Git 凭证助手 -> 建议
That populated the command field with:
用以下命令填充命令字段:
!"C:\Program Files (x86)\GitExtensions\GitCredentialWinStore\git-credential-winstore.exe"