1

I created a new Git repository but am unable to push it using terminal.

This is what I'm doing

git remote add origin https://github.com/dilipptt/first_app.git
git push origin master

and what I'm getting back:

error: Failed to connect to github.com:8080; Connection refused while accessing https://github.com/dilipptt/first_app.git/info/refs?service=git-receive-pack
fatal: HTTP request failed

random
  • 9,774
  • 10
  • 66
  • 83
theone1one
  • 1,510
  • 3
  • 20
  • 27
  • Show output of `git remote show origin` – Emil Davtyan Oct 13 '13 at 12:16
  • @EmilDavtyan dilip@linuxmint /media/dilip/New Volume1/rails_projects/first_app $ git remote show origin `error: Failed connect to github.com:8080; Connection refused while accessing https://git@github.com:dilipptt/first_app.git/info/refs?service=git-upload-pack fatal: HTTP request failed` – theone1one Oct 13 '13 at 12:50
  • Why is it trying to connect to port 8080? Do you have something in your `$HOME/.gitrc` that is messing with the port number? – Robin Green Oct 13 '13 at 13:13
  • http://stackoverflow.com/questions/3512202/github-https-access – Emil Davtyan Oct 13 '13 at 15:44
  • 1
    Perhaps you're using a proxy and need to unset `https_proxy`? http://stackoverflow.com/a/6080561/694469 – KajMagnus May 29 '14 at 00:42

1 Answers1

0

With the changes you have made, the GitHub URL you have configured is wrong. You should either use the HTTP url as in https://github.com/foo/bar.git or the SSH url as in git@github.com:foo/bar.git

When you added the origin for the second time, you specified git://git@github.com/dilipptt/first_app.git

Instead you should specify

git remote add origin git@github.com/dilipptt/first_app.git

Please copy and paste text from the error instead of posting screenshots. The latter is hard for people who want to help you.

harpun
  • 4,022
  • 1
  • 36
  • 40
sdqali
  • 2,234
  • 1
  • 13
  • 6
  • Can you post the output of `git remote -v`? – sdqali Oct 13 '13 at 16:12
  • `origin https://git@github.com:dilipptt/first_app.git (fetch) origin https://git@github.com:dilipptt/first_app.git (push)` – theone1one Oct 15 '13 at 05:51
  • Do the following: 1. `git remote rm origin` 2. `git remote add origin git@github.com:dilipptt/first_app.git` Notice how there is no `https://` in the second line. Cheers – sdqali Oct 15 '13 at 23:09