Try this:
$ vim ~/.ssh/config
Add
Host github.com
Hostname ssh.github.com
Port 443
Source: https://help.github.com/articles/using-ssh-over-the-https-port
The same works for Bitbucket:
Host bitbucket.org
Hostname altssh.bitbucket.org
Port 443
via (outdated / dead)
via, updated (2015-10-29)
In addition to configuring it with the ~/.ssh/config
file, you can also simply include the port number in the remote URL you use. You just have to
use a proper URL like ssh://user@host:port/path
instead of the user@host:path
shorthand; and
prepend the ssh.
subdomain to github.com
.
For instance, instead of
[email protected]:cdbennett/python-gitlab.git
use
ssh://[email protected]:443/cdbennett/python-gitlab.git
For gitlab, following can be added:
Host gitlab.com
Hostname altssh.gitlab.com
User git
Port 443
Source: Alternate Gitlab SSH Port
No need to modify the ~/.ssh/config
. You can add another remote repository via git remote add ..
.
// github
git remote add ssh://[email protected]:443/repo/name.git
// gitlab
git remote add ssh://[email protected]:443/repo/name.git
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With