Sometimes, git push will not work because ssh is not working correctly on the macOS VM. To fix the issue, run
GIT_SSH_COMMAND="ssh -o IPQoS=throughput" git push