Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git can not connect to github

Tags:

git

git-push

wifi

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 [email protected]

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  [email protected]:MyName/my_repo.git (fetch)
origin  [email protected]:MyName/my_repo.git (push)
like image 723
Andrew Avatar asked May 23 '26 23:05

Andrew


1 Answers

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

git remote set-url origin https://[email protected]/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)

like image 158
VonC Avatar answered May 25 '26 17:05

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!