1

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,

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.

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. So I tried removing the origin and add it as a HTTPS link using

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. And yes I tried pushing again,but the same error occurs. I even tried reinstalling Git,but the issue persists. 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. It would be better if there is a way to do this using HTTPS,rather than SSH.

P.S. : This happened not only when I was developing an Ionic app,but also other times,hence I believe Ionic was not the reason.

Sandun
  • 395
  • 2
  • 10
  • 25
  • git:// is *not* ssh though. – VonC Oct 08 '18 at 04:32
  • See Luca Geretti's answer https://stackoverflow.com/questions/11018358/fatal-error-on-git-push-origin-master .He refers git:// as ssh,right? – Sandun Oct 09 '18 at 13:02
  • No he does not. He is using `git@`, not `git://` – VonC Oct 09 '18 at 13:19
  • My bad,then.Thanks for the clarification.What I experienced was ' git:// '.I thought it meant SSH.Anyway I need a solution where I can go push to remote repo without any issues.(Better if it's via HTTPS). – Sandun Oct 09 '18 at 14:21
  • 1
    git:// is the git protocol: https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols#_the_git_protocol – VonC Oct 09 '18 at 14:38

1 Answers1

4

Why do not you git clone remote repo to https ?

First delete the local project before git clone

if you want ssh

first remove .ssh know host github url

and Re-register the public key.

derekpark
  • 147
  • 4
  • I suppose that you suggest to clone my repo.I dit it in both ways.1)Downloaded it as a zip and opened Git Bash inside that. 2)Opened GIt Bash in a certain directory and run 'git clone ' code . None of those solved the issue. – Sandun Oct 09 '18 at 13:05
  • Thank you for suggesting SSH method :) ,but I'd be more grateful if there is a way to use HTTPS because it is simpler. I have edited my question. – Sandun Oct 09 '18 at 13:11
  • i can not find you ionic repo. check remote repo is private or public if the repo is a private you can't access or wrong credentials. Instead of git clone https://github.com/NAME/repo.git url should be git clone https://username:password@github.com/NAME/repo.git – derekpark Oct 09 '18 at 14:24
  • It is because I have replaced my actual account name.Sorry about that.And it definitely is a public repository.And this does not happen for a certain repository.I tried that with several repos. And I did it using another computer as well. – Sandun Oct 09 '18 at 15:47