Skip to content

Instantly share code, notes, and snippets.

@eric-glb
Created August 21, 2023 15:07
Show Gist options
  • Save eric-glb/000cc858b001cce3634cb62dee25af26 to your computer and use it in GitHub Desktop.
Save eric-glb/000cc858b001cce3634cb62dee25af26 to your computer and use it in GitHub Desktop.
How to debug git CLI issues

How to debug git CLI issues

From: https://www.shellhacks.com/git-verbose-mode-debug-fatal-errors/

Debug Git command:

GIT_TRACE=true \
GIT_CURL_VERBOSE=true \
GIT_SSH_COMMAND="ssh -vvv" \
git clone git://host.xz/path/to/repo.git

Debug Git-related issues with the maximum level of verbosity:

GIT_TRACE=true \
GIT_CURL_VERBOSE=true \
GIT_SSH_COMMAND="ssh -vvv" \
GIT_TRACE_PACK_ACCESS=true \
GIT_TRACE_PACKET=true \
GIT_TRACE_PACKFILE=true \
GIT_TRACE_PERFORMANCE=true \
GIT_TRACE_SETUP=true \
GIT_TRACE_SHALLOW=true \
git clone git://host.xz/path/to/repo.git

Example to limit traces to a SSH public-key potential issue:

GIT_SSH_COMMAND="ssh -vvv" \
git clone git://host.xz/path/to/repo.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment