-1

I am trying to push a repo and the following error is being thrown on terminal.

fatal: remote error: 
  You can't push to git://github.com/<username>/<repoName>
  Use https://github.com/<username>/<repoName>

I have done some config changes in few days ago and I do not remember what I have done I have changed something related to this https:// and git:// but I have no idea how can I make this thing work again.

Diwakar Moturu
  • 652
  • 5
  • 13

1 Answers1

1

Updated because I botched the command before...

What you presumably changed is the remote URL. To fix it

git remote <remote-name> set-url https://github.com/<username>/<repoName>

should do it. (For <remote-name> probably it's origin. I'm assuming you know the real values for <username> and <repoName>...)

Mark Adelsberger
  • 42,148
  • 4
  • 35
  • 52
  • They are not changing, the remote urls. After I am executing this command, and again checking the remote using `git remote -v` they still remaining same with `git://` – Diwakar Moturu Dec 27 '16 at 19:37
  • Sorry, I goofed up the command. I believe I've fixed it, but I don't deal with remote changes much so could still have a mistake. If this doesn't work you could just remove the remote and then re-add it (with the correct URL) – Mark Adelsberger Dec 27 '16 at 19:50