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


当前回答

遇到这种情况是因为我在中国有防火长城…

kex_exchange_identity:连接被远程主机关闭 无法从远程存储库读取。 请确保您拥有正确的访问权限和存储库 的存在。

其他回答

我也犯了同样的错误,这让我得到了这个没有帮助的答案。 我试图创建一个新的“裸”存储库,第一次使用以下命令跟踪到NTFS位置:

cd myrepository
git init --bare \\myserver.mycompany.local\myrepository.git
git init
git status
git add .
git status
git commit -m "Initial Commit"
git remote add origin \\myserver.mycompany.local\myrepository.git
git push -u origin master
git status

我的问题原来是在NTFS位置中使用后斜杠而不是前斜杠,当试图添加原点来设置(新的)跟踪上游分支时。

我必须删除原点使用:

git remote rm origin

然后使用预期的正斜杠再次添加原点

git remote add origin //myserver.mycompany.local/myrepository.git

希望这对将来的人有所帮助。

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

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

在我的情况下,我使用ssh密钥与密码验证与github。我没有在Windows中正确地设置pageant(只有在cygwin中)。缺少的步骤是将git_ssh环境变量指向plink.exe。此外,你需要得到github.com到plink known_hosts。

   plink github.com
   y
   <then ctrl-c>

希望这能有所帮助!

我当然希望intellij能给我一个更有用的错误,或者让我输入ssh密钥密码。

对我来说,问题和答案就写在我面前。当天早些时候,我编辑了/etc/ssh/ssh_config文件并添加了一些密钥。这个错误说:

/etc/ssh/ssh_config: line 52: Bad configuration option: allowusers
/etc/ssh/ssh_config: terminating, 1 bad configuration options
fatal: Could not read from remote repository.

我删除了allowusers键和它的值,一切都按照预期工作。

添加到“我有同样的问题和……”,我也在Windows中通过Ming32 (git bash) shell使用git。

在我的情况下,回购要求我输入密码,不使用SSH密钥,但它没有提示密码,只是说“致命:无法读取…”,尽管我可以SSH正常,使用plink和SSH,并设置了两个已知的主机密钥。

我尝试了这里和其他SOs的大部分建议。

最后我发现它在Powershell中工作得很好,但在git bash中不行,没有任何更改或更正。