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


当前回答

尝试使用未设置的GIT_SSH删除GIT_SSH环境变量。这就是我的问题所在。

其他回答

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

我有同样的问题,一段时间后,我看到我在根用户(sudo -s)。希望这对某人有所帮助。

我也有同样的问题。

此错误意味着您没有指定代码将在其上进行推送的远程URL位置。

远程URL设置主要有2种方式:

通过在Git Bash上执行命令指定远程URL。 导航到项目目录 打开Git Bash 执行命令: git remote set-url origin <https://abc.xyz/USERNAME/REPOSITORY.git> 在配置文件中直接提到远程URL 导航到项目目录 移动到。git文件夹 在文本编辑器中打开配置文件 复制并粘贴以下行 (远程“起源”) url = https://abc.xyz/USERNAME/REPOSITORY.git Fetch = +refs/heads/*:refs/remotes/origin/*

欲了解更多详细信息,请访问此链接。

对我来说非常简单的解决方案,见下面:-

问题

$ git clone git@github.com:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

这也会超时

$ ssh -T git@github.com
ssh: connect to host github.com port 22: Connection timed out

这可能有用

$ ssh -T -p 443 git@ssh.github.com
Hi xxxx! You've successfully authenticated, but GitHub does not provide shell access.

覆盖SSH设置

$ vim ~/.ssh/config

# You can also manually open the file and copy/paste the section below
# Add section below to it
Host github.com
  Hostname ssh.github.com
  Port 443

然后再试一次

$ ssh -T git@github.com
Hi xxxxx! You've successfully authenticated, but GitHub does not
provide shell access.

现在试试克隆(应该有用)

$ git clone git@github.com:xxxxxx/xxxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 15 (delta 0), reused 15 (delta 0), pack-reused 0
Receiving objects: 100% (15/15), 22.90 KiB | 4.58 MiB/s, done.

参考:here =>使用端口443的HTTPS

您可以指定SSH应该发送到远程系统的用户名作为远程URL的一部分。在远程主机名之前输入用户名,后面加@。

git remote set-url website abc@***.com:path/to/repo