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


当前回答

2020年10月更新

在大多数情况下,当您有多个用户从同一个客户端系统访问同一个git服务器时,该时间git服务器将访问密钥与用户混淆,但当您发出命令时,它将使用默认用户。

ssh -T git@gitlab.com

看看哪些用户是你想要积极推动的用户

简单的解决方案是从git服务器中删除未使用的用户公钥。

然后试着去取或拉,推它会为我工作

其他回答

对于那些有此问题的私人远程回购。确保你在远程服务器上接受了Xcode协议:我们花了几周时间才找到这个解决方案

从命令行使用这个命令:sudo xcodebuild -license

I would recommend to check all remotes you have configured with git remote -v If you had your repo configured to a remote that was deleted you will receive this error message: fatal: Could not read from remote repository. Please make sure you have the correct access rightsand the repository exists. Even when trying to push or pull to an other (existing) remote. So if you have a remote that was deleted, you can remove with git remote remove name-of-remote-to-remove and after that you can push or pull to your existing remotes without problems.

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

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

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

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

如果您使用Gitlab,则可能需要在尝试拉或推之前登录并接受Gitlab的新术语。