0

I tried deploying my first heroku code, but when I run git push heroku master, i get an error as:

ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

git remote -v gives,

heroku  git@heroku.com:dry-stream-5959.git (fetch)
heroku  git@heroku.com:dry-stream-5959.git (push)

what is the problem?why wont the code be deployed?

Aswin Murugesh
  • 10,831
  • 10
  • 40
  • 69
  • Doesn't look like you're pushing to heroku, git is complaining that the connection to `github.com` is timing out. I somewhat recall having that issue in the past, would you mind posting your `git status`? – Thomas Orozco Sep 16 '13 at 20:28
  • @ThomasOrozco: `git status` command gives: git status # On branch master nothing to commit, working directory clean – Aswin Murugesh Sep 16 '13 at 20:47

3 Answers3

2

I find strange that a git push heroku master references "github.com".
If you have to push to heorku.com, try a:

git remote set-url heroku git@heroku.com:dry-stream-5959.git

Then repeat your git push.
If the problem persists, and ssh port is blocked, then followed the aforementioned link, but replacing github.com by heroku.com.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Now again I get this error: `ssh_exchange_identification: Connection closed by remote host fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.` – Aswin Murugesh Sep 19 '13 at 10:39
  • Sorry I am completely new to this and so I do not know anything about this – Aswin Murugesh Sep 19 '13 at 10:41
  • @AswinMurugesh As mentioned in https://www.heroku.com/, did you create your repo on heroku side? `heroku create dry-stream-5959`: follow carefully https://devcenter.heroku.com/articles/git. – VonC Sep 19 '13 at 11:30
  • I already used `heroku create` and only then got this name. Now if I give this command, I get `name already taken` – Aswin Murugesh Sep 19 '13 at 14:13
  • @AswinMurugesh then modify the remote url in order to match the name of your heroku app on the server. – VonC Sep 19 '13 at 14:16
  • Ya I did that. I changed the App's name in heroku.com and then changed the remote URL too. – Aswin Murugesh Sep 19 '13 at 14:45
0

SSH is probably blocked on port 22.

Check out this answer, it might help you out.

Community
  • 1
  • 1
Quine
  • 158
  • 4
0

It is usually usefull to make a:

ssh -vvv yourlogin@heroku

in order to dispay all the operations taking place during the ssh communication.

Various causes can be at the origin of these,

  • from a $HOME not correctly defined (usual on Windows where the environment variable %HOME% isn't defined at all by default)
  • to an IP conflict address (see this thread) for the SSH daemon.

See also answer:// Unable to Git-push master to Github

Community
  • 1
  • 1
Harshit Agarwal
  • 878
  • 3
  • 10
  • 19