Does Git have a debug or verbose option explaining what it is doing? [duplicate]
Asked Answered
E

1

5

Do some or all git commands have debug or verbose options which explain what they are attempting or what other sub-commands are being executed?

Eyebolt answered 30/5, 2017 at 10:31 Comment(3)
Did you consult man pages? I sometimes use strace, though :)Somnambulate
You could check this answersBunce
If a question suggested as a duplicate answers it well enough, do I delete my question, leave it if has an answer which has more related and useful info, or simply close it?Eyebolt
F
11

This question is already answered. Please have a look How can I debug git/git-shell related problems?

To answer your question and give a quick reference, yes, there are! The following environment variables that are present in git:

GIT_SSH, GIT_TRACE, GIT_FLUSH, GIT_TRACE_PACK_ACCESS, GIT_TRACE_PACKET, GIT_TRACE_PERFORMANCE, GIT_TRACE_SETUP, GIT_CURL_VERBOSE, GIT_REFLOG_ACTION, GIT_NAMESPACE, GIT_DIFF_OPTS, GIT_EXTERNAL_DIFF, GIT_DIFF_PATH_COUNTER, GIT_DIFF_PATH_TOTAL, GIT_MERGE_VERBOSITY.

Usage:

Method 1: Just prepending the environment variables before the command: GIT_TRACE=1 GIT_CURL_VERBOSE=1 git YourCommandHere

Method 2: set -i; GIT_TRACE=2 GIT_CURL_VERBOSE=2 GIT_TRACE_PERFORMANCE=2 GIT_TRACE_PACK_ACCESS=2 GIT_TRACE_PACKET=2 GIT_TRACE_PACKFILE=2 GIT_TRACE_SETUP=2 GIT_TRACE_SHALLOW=2 git YourCommandHere -v -v; set +i

Also, you can have a look Git Environment Variables.

Fungi answered 30/5, 2017 at 10:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.