I am under a proxy and I am pushing in to git successfully for quite a while.
Now I am not able to push into git all of a sudden.
I have set the RSA key and the prox
Execute:
nc -v -z <git-repository> <port>
Your output should look like:
"Connection to <git-repository> <port> port [tcp/*] succeeded!"
If you get:
connect to <git-repository> <port> (tcp) failed: Connection timed out
You need to edit your ~/.ssh/config file. Add something like the following:
Host example.com
Port 1234
When I accidentally switched to a guest wifi network I got this error. Had to switch back to my default wifi network.
Git provides a way to rewrite URLs using git config. Simply issue the following command:
git config --global url."https://".insteadOf git://
Now, as if by magic, all git commands will perform a substitution of git://
to https://
source: git:// protocol blocked by company, how can I get around that?
The reason could be the firewall modification as you are under a network.(In which case they may deliberately block some ports)
To double check if this is the reason ... do
ssh -T git@github.com
this should timeout.
If that's the case use http protocol instead of ssh this way
just change your url in the config file to http.
Here is how :-
git config --local -e
change entry of
url = git@github.com:username/repo.git
to
url = https://github.com/username/repo.git
The main reason was the change from the proxy installed by the company recently, which has blocked other ssh connections other than those to the company domain.
I was able to connect successfully by following these steps:
ssh -T git@github.com
It should end up in a timeout.
ssh config --local -e
and from
url=git@github.com:asheeshjanghu/Journal.git
to
url=https://github.com/asheeshjanghu/Journal.git
The important point is that in the url you have to change at 2 places.
from git@
to https://
and from github:username
to github/username
In the end verify by doing a git fetch
inside the .ssh folder Create "config" file
Host github.com
User git
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
Host gitlab.com
Hostname altssh.gitlab.com
User git
Port 443
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa