Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Temporarily using a different protocol with remote repository

I've on my laptop a git repository, and a remote repository on GiHub (a straight forward configuration created when running 'git clone').

I'm using the SSH transfer protocol. i.e. remote address is: [email protected]:MyName/MyProg.git

I'm now in a network environment where port 23 is blocked (As far as I can see, only ports 80 and 443 are open). I need to fetch/merge recent changes available on the server. What are my options? If possible, I'd like to avoid creating a new remote branch with the http protocol (which is basically identical to the remote branch I already have).

like image 754
Uri Avatar asked Feb 16 '23 00:02

Uri


1 Answers

You could change url of the origin:

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

and work as usual. Then change it back if port unblocked.

Second approach. You could change port which ssh uses by its config. github also provides ssh connection via port 443. For this you need to create a file ~/.ssh/config with the following content:

Host github.com
  Hostname ssh.github.com
  Port 443

For debugging you could use ssh -v [email protected].

BTW, ssh port is number 22, not 23.

like image 111
kan Avatar answered Feb 23 '23 00:02

kan