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?

3
  • Did you consult man pages? I sometimes use strace, though :) Commented May 30, 2017 at 10:34
  • You could check this answers Commented May 30, 2017 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? Commented May 30, 2017 at 12:04

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.