致命:推送到 Git 仓库时远程端意外挂断

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6808653/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 11:24:39  来源:igfitidea点击:

Fatal: The remote end hung up unexpectedly while pushing to Git repository

gitpush

提问by Neil

I created a new repository called DirectorySocket, and from my project directory called DirectorySocket I did the following:

我创建了一个名为 DirectorySocket 的新存储库,并从名为 DirectorySocket 的项目目录中执行了以下操作:

$ git init
$ git add .
$ git remote add origin [email protected]:neilghosh/DirectorySocket.git
$ git commit -m "Initial version"
$ git push origin master

And I got the following error:

我收到以下错误:

ERROR: Permission to neilghosh/DirectorySocket.git denied to neilghosh/googly. fatal: The remote end hung up unexpectedly

错误:neilghosh/DirectorySocket.git 的权限被 neilghosh/googly 拒绝。致命:远端意外挂断

Why is it trying to push to another repository of mine on GitHub? This happens also after I deleted the .gitfolder and started over.

为什么它试图推送到我在 GitHub 上的另一个存储库?在我删除.git文件夹并重新开始后,也会发生这种情况。

采纳答案by manojlds

Since it is your repository, check if the keys and token are setup properly as per the instructions provided by GitHub.

由于它是您的存储库,请根据 GitHub 提供的说明检查密钥和令牌是否设置正确。

http://help.github.com/win-set-up-git/

http://help.github.com/win-set-up-git/

As a first step, see if

作为第一步,看看

 ssh -T [email protected]

works.

作品。

回答by Nate

There are a couple of leads here- it is most likely an authorization issue. Have you uploaded your public key to GitHub?

有几个线索在这里-这是最有可能的授权问题。你有没有将你的公钥上传到 GitHub?

What is your network situation? I get this response behind my restrictive corporate firewall - the answer there is to use the smart HTTP supportnow supported by GitHub.

你的网络情况如何?我在我的限制性公司防火墙后面得到了这个响应 - 答案是使用GitHub 现在支持的智能 HTTP 支持

回答by Flavio Wuensche

Direct link to GitHub explanation here:

GitHub 解释的直接链接在这里:

https://help.github.com/articles/generating-ssh-keys

https://help.github.com/articles/generating-ssh-keys