简体   繁体   English

Git推送到远程存储库给出致命错误SSH HTTPS

[英]Git push to remote repository gives fatal error SSH HTTPS

I am developing an ionic app,and I use Git as my version control method.My remote repository is located in GitHub.Whenever I am trying to push some content from my local repository to remote repository,Git will give this Fatal Error, 我正在开发一个离子应用程序,我使用Git作为版本控制方法。我的远程存储库位于GitHub。每当我尝试某些内容从本地存储库送到远程存储库时,Git都会出现此致命错误,

fatal: remote error:
  You can't push to git://github.com/evilmin/ionicMyApp.git
  Use https://github.com/evilmin/ionicMyApp.git

I checked the remote links using the command git remote -v and it gave me this output. 我使用命令git remote -v检查了远程链接,它给了我这个输出。

origin  git://github.com/evilmin/ionicMyApp.git (fetch)
origin  git://github.com/evilmin/ionicMyApp.git (push)

Means the error was right and the links are in SSH. 表示错误正确,链接位于SSH中。 So I tried removing the origin and add it as a HTTPS link using 所以我尝试删除源并将其添加为使用的HTTPS链接

git remote rm origin
git remote add origin https://github.com/evilmin/ionicMyApp.git

But when I run the git remote -v to check the remotes,I get the same output that I have mentioned above,which means the links are still in SSH,and my command has not worked. 但是当我运行git remote -v来检查远程服务器时,得到的输出与我上面提到的相同,这意味着链接仍在SSH中,并且我的命令无效。 And yes I tried pushing again,but the same error occurs. 是的,我尝试再次推送,但是发生相同的错误。 I even tried reinstalling Git ,but the issue persists. 我什至尝试重新安装Git ,但问题仍然存在。 Whatever the repository is,every time I try to push from a local repo to its remote repo,it will give me this error. 无论存储库是什么,每次我尝试从本地存储库推送到其远程存储库时,都会出现此错误。 My main concern is how to enable push functionality again in Git.Any ideas would be helpful. 我主要关心的是如何在Git中再次启用推送功能 。任何想法都会有所帮助。 It would be better if there is a way to do this using HTTPS,rather than SSH. 如果有一种方法可以使用HTTPS而不是SSH来完成,那会更好。

PS : This happened not only when I was developing an Ionic app,but also other times,hence I believe Ionic was not the reason. PS:这不仅发生在我开发Ionic应用程序时,还发生在其他时候,因此我相信Ionic不是原因。

Why do not you git clone remote repo to https ? 您为什么不git将远程仓库克隆到https?

First delete the local project before git clone git clone之前先删除本地项目

if you want ssh 如果你想要ssh

first remove .ssh know host github url 首先删除.ssh知道主机github url

and Re-register the public key. 并重新注册公共密钥。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM