daleyjem
daleyjem

Reputation: 2674

git push hangs... could be ssh config related

I'm happy to close this issue if there's a duplicate with a viable solution, but somewhere in the last few months, I'm stuck with git push hanging on Mac 10.15.7 (not sure if that's related). This doesn't seem to be based on Github or Gitlab, etc. I think it has something to do with SSH itself.

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.com port 22.

At one point, I killed ssh-agent from "Activity Monitor" and I was able to push once, but since then, it's been recurring with no instances of ssh-agent or ssh even appearing in "Activity Monitor".

Upvotes: 1

Views: 321

Answers (2)

daleyjem
daleyjem

Reputation: 2674

I hate answering my own questions, but I looked for a solution to this for a few days. Turns out, using netcat as the SSH proxy command helped resolve my issue.

Edit (or create) ~/.ssh/config with the following:

Host *
  ProxyCommand nc %h %p

Note: I wouldn't put this in the /etc/ssh/ssh_config, as it may get overwritten or something after an OS update.

Upvotes: 1

VonC
VonC

Reputation: 1324577

Try, for testing, using a PEM SSH key (register the public key), without passphrase (just to check if SSH itself is broken)

ssh-keygen -t rsa -m PEM -P "" -f ~/.ssh/testKey
# register testKey.pub to your GitLab profile
ssh -Tv -i ~/.ssh/testKey ssh://[email protected]

If you see a welcome message, try and export GIT_SSH='ssh -i ~/.ssh/testKey', then try your git push again.

Upvotes: 0

Related Questions