If you are moving your development machine from an unrestricted to a restricted network and back, the chances are high that you will have problems using ssh or git dependent on the network where your computer is currently set up.
A good way to circumvent this is to use a local development proxy (like fiddler) on your computer and to tunnel all connections through it.
For example I am running fiddler on my machine on port 8888 (accepting external connections) and I am using the following setup:
# in .bashrc of git for windows
export https_proxy=http://localhost:8888
export http_proxy=$https_proxy
export ftp_proxy=$https_proxy
export HTTPS_PROXY=$https_proxy
export HTTP_PROXY=$https_proxy
export FTP_PROXY=$https_proxy
export no_proxy={...list of my local addresses and domains...}
export NO_PROXY=$no_proxy
You also don't need extra tooling to configure git and ssh to use your proxy through a tunnel as git for windows comes with connect tool which can tunnel SSH connections through https.
in /etc/ssh/ssh_config of the git shell:
Host *
ProxyCommand connect -H localhost:8888 %h %p
IdentityFile ~/.ssh/id_rsa
TCPKeepAlive yes
IdentitiesOnly yes
Host github.com
user git
Port 22
Hostname github.com
Host gitlab.com
user git
Port 22
Hostname gitlab.com
You might also want to check out las and its ssh helper.
https://code.siemens.com/linux/las
https://code.siemens.com/linux/las/blob/master/doc/siemens-proxy/siemens-proxy.md#siemens-proxy-ssh_config