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


当前回答

我解决了这个问题,改变我的url从

https://gitlab.com/{gitlab_user}/project_repo.git

to

https://{gitlab_user}@gitlab.com/gitlab_user/project_repo.git

使用命令

git remote set-url https://{gitlab_user}@gitlab.com/gitlab_user/project_repo.git

其他回答

在做了一些研究之后,我终于找到了解决方案,你已经声明了一个环境变量到plink.exe路径。因此,如果您删除了该路径,重新打开git bash并尝试通过SSH克隆它,它将工作。

请参阅此连结

http://sourceforge.net/p/forge/site-support/2959/#204c

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

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

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

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

如果您设置了receievepack或uploadpack 在我的情况下,我得到的错误设置后,他们的错误

receivepack = powershell git receive-pack

在我的例子中。git/config

你可以删除他们的答案如下所示

https://stackoverflow.com/a/26207308/7668448

或者直接修改.git/config

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