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?
-
Did you consult man pages? I sometimes use `strace`, though :) – May 30 '17 at 10:34
-
You could check this [answers](https://stackoverflow.com/questions/25388499/how-can-i-run-git-push-pull-commands-with-ssh-verbose-mode) – Konrad 'Zegis' May 30 '17 at 10:49
-
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? – vfclists May 30 '17 at 12:04
1 Answers
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.

- 211
- 2
- 7