Git
git is not a network tool, but fetches and pushes fail for network reasons all the time: SSH key problems, TLS interception by corporate proxies, blocked ports. Git has built-in knobs that expose what its transport (SSH or HTTPS) is actually doing.
If you use Git accounts in several organizations from one machine, see Git and SSH.
Availability
| Platform | How to get it |
|---|---|
| Windows (Cygwin) | install the git package |
| Windows (native) | Git for Windows |
| Fedora | sudo dnf install git |
| Ubuntu / Debian | sudo apt install git |
Debugging SSH
Make git’s underlying ssh invocation verbose. The output shows which key is offered, which host key is received, and where authentication fails:
GIT_SSH_COMMAND="ssh -vvv" git clone <REPO_SSH_URL>
Test SSH authentication to the host directly, without git:
ssh -T git@github.com
Debugging HTTPS
Show the full HTTP conversation including TLS handshake and proxy usage:
GIT_CURL_VERBOSE=1 GIT_TRACE=1 git clone <REPO_HTTPS_URL>
Point git at a corporate CA bundle when a TLS-intercepting proxy breaks certificate verification (prefer this over disabling verification):
git config --global http.sslCAInfo /path/to/corporate-ca-bundle.pem