Log Git HTTPS Requests Verbosely | Generated by AI

Home 2026.02

Question: When running git pull –rebase, how to log the HTTP and HTTPS requests?

Answer:

Your example output shows an SSH connection (Authenticated to github.com ([20.205.243.166]:22) using "publickey"), not HTTP/HTTPS. GitHub uses SSH by default when your remote URL is in the git@github.com:... format.

To actually see HTTP/HTTPS traffic, you need to:

  1. Make sure you’re using an HTTPS remote (most common when you see password/PAT prompts)
  2. Enable Git’s built-in verbose logging for curl (which Git uses for http/https)

Check your current remote URL

git remote -v

Switch to HTTPS (if you want to log HTTP/HTTPS requests)

git remote set-url origin https://github.com/owner/repo.git
# or for GitHub with token: https://username:ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@github.com/owner/repo.git

Log HTTP/HTTPS requests (when using HTTPS remote)

Use one or more of these environment variables before the git command:

# Most useful & common combination – shows full curl verbose output (headers, TLS handshake, etc.)
GIT_CURL_VERBOSE=1 git pull --rebase

# Even more detailed (packet level + curl + general trace)
GIT_TRACE=1 GIT_TRACE_PACKET=1 GIT_CURL_VERBOSE=1 git pull --rebase

# Save to file (very recommended)
GIT_CURL_VERBOSE=1 git pull --rebase 2>&1 | tee git-http.log

# Or maximum debugging
GIT_TRACE=1 GIT_TRACE_PACKET=1 GIT_TRACE_CURL=1 GIT_CURL_VERBOSE=1 git pull --rebase 2>&1 | tee git-debug.log

What each variable does

Quick one-liner examples

# Quick look at headers & TLS
GIT_CURL_VERBOSE=1 git pull --rebase

# Very detailed log saved to file
GIT_TRACE=1 GIT_TRACE_PACKET=1 GIT_CURL_VERBOSE=1 git fetch --verbose 2>&1 | tee ~/git-network.log

If you want to log SSH instead

For SSH protocol logging:

GIT_SSH_COMMAND="ssh -vvv" git pull --rebase

or even more verbose:

GIT_SSH_COMMAND="ssh -vvvv" git pull --rebase 2>&1 | tee ssh-debug.log

Use GIT_CURL_VERBOSE=1 when your remote uses https:// — that’s the standard way to see HTTP and HTTPS requests made by Git.

References:


Back Donate