我试图设置git与http://danielmiessler.com/study/git/#website来管理我的网站。

我已经到了指令的最后一步:git push website +master:refs/heads/master

我正在win7中使用git ming32命令行工作

$ git push website +master:refs/heads/master
Bill@***.com's password:
Connection closed by 198.91.80.3
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

这里的一个问题可能是程序正在寻找bill@* **.com。当我通过ssh连接到我的网站,我有一个不同的用户名(让我们说'abc')。也许这个应该是abc@***。com。如果是这样,我不知道如何改变这一点,或者如果我可以推下一个别名


当前回答

我换了电脑后出现了这个错误。我使用SourceTree和Bitbucket。

所以我必须在新电脑上添加SourceTree生成的SSH密钥,在比特桶设置>安全> SSH密钥,同时连接到我的网络比特桶帐户。

其他回答

实际上,我尝试了很多方法让它在Win7上工作,因为将SSH exectun从本机更改为build-it和向后更改,同样的错误。 偶然,我在“。”中将其更改为HTTPS。Git /config"文件如下:

[remote "origin"]
        url = https://github.com/user_name/repository_name.git
        fetch = +refs/heads/*:refs/remotes/origin/*

最终成功了。所以也许对你也有用。

如果在“git push origin master”命令后,你看到错误“could not read from remote repository”,然后试试这个

1.ssh-keygen -t rsa -b 4096 -C "youremail"
2.eval $(ssh-agent -s)
3.ssh-add ~/.ssh/id_rsa
4.clip < ~/.ssh/id_rsa.pub(it copies the ssh key that has got generated)
5.then go to your remote repository on github and goto settings-> SSH and GPG keys ->new SSH key ->enter any title and paste the copied SSH key and save it
6. now give git push origin master 

我在windows 10上使用gitbash时遇到了这个问题。我尝试了几种方法来解决这个问题,主要是:

重新创建我的ssh密钥并更新到bitbucket。没有帮助 打开调试使用这个,并发现我得到了“shell请求失败在通道0”,在这里询问 重启我的windows电脑

以上这些都没用。我最终为windows重新安装了Git,这只花了几分钟,与我所做的其他事情相比,它解决了问题!

我通过重新启动终端解决了这个问题(打开一个新的窗口/选项卡)。

所以如果你真的不想/不需要理解潜在的问题,在深入挖掘之前,测试方法值得一试:)

在我的情况下,它是postBuffer..

git config --global http.postBuffer 524288000

参考阅读:https://gist.github.com/marcusoftnet/1177936