我试图设置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。如果是这样,我不知道如何改变这一点,或者如果我可以推下一个别名


当前回答

在我的例子中,bitbucket的web ssh密钥设置UI令人困惑。

存储库设置—>接入键—>添加键:错误

个人设置—> SSH密钥—>添加密钥:Ok

公钥注册界面互斥。您只能在一个地方注册公钥。把它们统一在一个屏幕上似乎很好。

其他回答

在极少数情况下,您将得到“致命:无法从远程存储库读取”错误,如在

[user@example.com repo]$ git fetch --all --prune
Fetching origin
exec request failed on channel 0
fatal: Could not read from remote repository.

当Git服务器文件系统已满时。要验证这一点,请运行:

ssh -v ssh://git@yourhost/path/repo.git

如果服务器像这样回复:

...
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Offering public key: /home/...
SHA256:...
debug1: Server accepts key: /home/...
SHA256:...
Authenticated to linux-git.....com ([xxx.xxx.xx.xx]:xx) using "publickey".
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: filesystem full
...
debug1: Remote: PTY allocation disabled.
PTY allocation request failed on channel 0
shell request failed on channel 0

服务器的磁盘空间会被占满。

我知道这个答案不会得到很多人的支持;为了完整起见,添加它。

附注:也可以使用类似

GIT_SSH_COMMAND="ssh -v" git pull

诊断问题。

您的ssh密钥很可能已从ssh代理中删除

ssh-add ~/.ssh/id_rsa

哪里id_rsa是与git repo相关联的SSH密钥

更新

您可能会得到无法打开到您的身份验证代理的连接。错误,解决您需要首先启动代理的问题:

eval `ssh-agent -s`

实际上,我尝试了很多方法让它在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/*

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

我遇到了同样的错误,但如果您再次传递命令,您将注意到提示:您确定要继续连接(是/否)?,然后输入“yes”,然后按回车键就可以解决了。

在做了一些研究之后,我终于找到了解决方案,你已经声明了一个环境变量到plink.exe路径。因此,如果您删除了该路径,重新打开git bash并尝试通过SSH克隆它,它将工作。

请参阅此连结

http://sourceforge.net/p/forge/site-support/2959/#204c