3

I'm facing strange behaviour of git and wireless network.

There are three wireless connections available. When using two of them (one of them is at home, the other - in office), I can push to github with no problem. But when I connect to the third one (this one is at home as well), the following command

git push origin

results in endless expectation of any outcome. This expectations only finishes when I break the process. By the way,

ssh -T git@github.com

returns

You've successfully authenticated, but GitHub does not provide shell access.

Once I connect to other networks, everything works fine.

P.S. As it was asked:

git remote -v
origin  git@github.com:MyName/my_repo.git (fetch)
origin  git@github.com:MyName/my_repo.git (push)
Andrew
  • 2,148
  • 5
  • 23
  • 34
  • [What do you mean by 'expectation'?] Could the third network be so slow that waiting is to be expected? – GoZoner Jun 05 '13 at 14:19
  • How are configured your remotes ? Please add `git remote -v` output to your question. – Guillaume Darmont Jun 05 '13 at 14:24
  • By 'expectation' I meant that the command produced NO output at all. And it lasts until I press Ctrl+C. The network is not so slow -I can easily see a movie online. – Andrew Jun 05 '13 at 14:25

1 Answers1

3

If ssh fails for some reason, try and switch to an https protocol:

git remote set-url origin https://MyName@github.com/MyName/my_repo.git 

See if that still hangs, or if it does ask you for your GitHub's account password.

(note that you can cache those credentials with a credential-helper)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks! The only modification I had to do was **git remote set-url origin** `https://github.com/MyName/my_repo.git` – Andrew Jun 05 '13 at 16:06
  • This slight variation worked for me: I added `url = https://github.com/MyOrganisation/my_repo.git` to my `.git/config` and commented out the usual SSH url for my remote. This way I can put the regular setting back when I'm not on a restricted public wifi. – lavaturtle Dec 12 '14 at 18:43