Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git - Use port 9418 for remote on github

Tags:

git

bash

github

I am trying to connect to github at school but port 443 is blocked.

The admin told me to use port 9418 instead which I believe is the default port for the git protocol.

But in git bash (windows) if i try to do git remote set-url origin git://github.com/me/myrepo.git and do a push, it tells me I can't push to this URL, and to use https://github... instead.

How can I configure git to use port 9418 ?

like image 622
Rayjax Avatar asked Sep 26 '13 08:09

Rayjax


2 Answers

From github documentation:

You can only push to one of two writeable protocol URL addresses. Those two include an SSH URL like [email protected]:user/repo.git or HTTPS URL like https://github.com/user/repo.git.

So you need open port 22 or 443 to work, git protocol is read only.

like image 72
valodzka Avatar answered Sep 28 '22 07:09

valodzka


check : ReadyState4 or git remote add with other ssh port

One way : git remote add origin ssh://[email protected]:<port>/<project name>


Second way : change the .git/config

old:

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = [email protected]:<project name>

new:

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = ssh://[email protected]:<port>/<project name>
like image 30
hustljian Avatar answered Sep 28 '22 07:09

hustljian