-->

DEVOPSZONES

  • Recent blogs

    Weekend Read: How to Debug Git for fatal Errors

    Weekend Read: How to Debug Git for fatal Errors

    Git's default level of verbosity can make it difficult to diagnose some issues, such as "git refusing to work with credential missing host field" or "fatal: authentication failed".

    git


    Knowing how to boost verbosity in Git is incredibly beneficial for debugging various network, security, performance, and other issues.


    In this note, I'll demonstrate how to use the command line to troubleshoot Git problems in Linux, MacOS, and Windows by making Git commands more verbose.


    Git Verbose Mode in Linux/MacOS


    Debug Git command:

    $ GIT_TRACE=true \

    GIT_CURL_VERBOSE=true \

    GIT_SSH_COMMAND="ssh -vvv" \

    git clone https://github.com/manastri/test-github-actions.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 https://github.com/manastri/test-github-actions.git


    Git Verbose Mode in Windows


    Debug Git command:

    C:\> set GIT_TRACE=true

    C:\> set GIT_CURL_VERBOSE=true

    C:\> set GIT_SSH_COMMAND=ssh -vvv

    C:\> git clone https://github.com/manastri/test-github-actions.git


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

    C:\> set GIT_TRACE=true

    C:\> set GIT_CURL_VERBOSE=true

    C:\> set GIT_SSH_COMMAND=ssh -vvv

    C:\> set GIT_TRACE_PACK_ACCESS=true

    C:\> set GIT_TRACE_PACKET=true

    C:\> set GIT_TRACE_PACKFILE=true

    C:\> set GIT_TRACE_PERFORMANCE=true

    C:\> set GIT_TRACE_SETUP=true

    C:\> set GIT_TRACE_SHALLOW=true

    C:\> git clone https://github.com/manastri/test-github-actions.git


    To avoid the error below, the variable GIT_SSH_COMMAND=ssh -vvv in Windows CMD must be set without quotes: “fatal: ssh variant ‘simple’ does not support setting port


    No comments