我试图设置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远程添加origin https://your/repository/url

其他回答

这通常是由于SSH密钥与远程不匹配造成的。

解决方案:

转到终端,输入以下命令(Mac, Linux)替换为您的电子邮件id。 ssh -t rsa -C "you@email.com" 从word ssh开始,使用以下命令复制生成的密钥。 猫~ / . ssh / id_rsa . pub 粘贴在github, bitbucket或gitlab各自的远程。 保存它。

对我来说,问题和答案就写在我面前。当天早些时候,我编辑了/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键和它的值,一切都按照预期工作。

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

   plink github.com
   y
   <then ctrl-c>

希望这能有所帮助!

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

如果在“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 

我只是想分享我找到了一个简单的解决方法:

拒绝访问。 无法从远程存储库读取。 请确保您拥有正确的访问权限 并且存储库存在。

从gitlab注销,然后重新登录。这些问题应该得到解决。