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


当前回答

在我的情况下,它是postBuffer..

git config --global http.postBuffer 524288000

参考阅读:https://gist.github.com/marcusoftnet/1177936

其他回答

不是OP的问题,但如果你在一个GitHub组织/团队中工作,你可能没有对存储库的写权限。不幸的是,git没有显示更具体的权限错误。在我的例子中,我正在使用一个私有存储库,并被授予了“Triage”或“Read”访问权限。

有关每个权限级别的存储库访问的更多信息,请参阅GitHub文档。

在GitHub上更改这一点的链接是https://github.com/orgs/ORGANISATION_NAME/teams/TEAM_NAME/repositories,在那里您可以更改给予团队的权限。

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

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

在你的。git/config文件中

[remote "YOUR_APP_NAME"]
    url = git@heroku.com:YOUR_APP_NAME.git
    fetch = +refs/heads/*:refs/remotes/YOUR_APP_NAME/*

并简单地

git push YOUR_APP_NAME master:master 

确保你在.git/config中有正确的url

url = git@github.com:username/repo.git

如果这是你第一次推,你需要在正确的上游设置

$ git push -u origin master

你可以检查哪个键被使用:

$ ssh -vvv git@github.com

回复应该包含如下内容:

debug1: Next authentication method: publickey
debug1: Offering RSA public key: ~/.ssh/id_rsa
...
You've successfully authenticated, but GitHub does not provide shell access.

也可以在~/中为ssh定义规则。Ssh /config,例如基于别名:

   Host github
      HostName github.com 
      User git
      IdentityFile "~/.ssh/id_rsa"

   Host git
      HostName github.com 
      User git
      IdentityFile "~/.ssh/some_other_id"

您可以为每个别名设置连接到不同的端口,使用不同的用户名等。

有类似的问题。 我已经通过这条指令(ssh-keygen)生成ssh密钥到我的帐户,或者如果你已经有一个添加它,不生成新的一个。 然后我通过命令shell更改了我的全局凭据,如果你已经克隆了repo,它们也可以在项目根目录中本地更改项目(删除全局标志),但这不是我的情况。 git配置——global user.name“你的姓” Git配置——全局用户。电子邮件“youremail.com”