After updating to Catalina 10.15.4, git
started hanging indefinitely when trying to push or pull from a repo that was previously accessible.
$ git push origin master
^C
The URL for origin
looks like:
$ git remote -v
origin ssh://git@gitlab.example.com:30814/username/project.git (fetch)
origin ssh://git@gitlab.example.com:30814/username/project.git (push)
Attempting to ssh directly to the remote results in a hang:
$ /usr/bin/ssh -p 30814 git@gitlab.example.com -vvv
OpenSSH_8.1p1, LibreSSL 2.7.3
debug1: Reading configuration data /Users/username/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug1: Connecting to gitlab.example.com port 30814.
^C
Which seems to indicate the underlying problem with git
is the ssh://
URI for the remote repository. I confirmed this by successfully cloning the repo using a https://
URI.
Best Answer
Debugging steps:
After refreshing my shell environment to ensure that the new ssh is found in my
$PATH
, git operations began functioning as expected withssh://
URIs.Searching turned up this user submitted bug: ssh fails when using -p flag
The workaround detailed in the bug is to use the remote host's IP address instead of the DNS name. I can confirm that this worked for me:
The apparent trigger for this bug is using ports greater than 8192 in conjunction with a host's DNS name.