Home Explore Blog CI



git

10th chunk of `Documentation/git.adoc`
057707fa9b1bc2ac83aaf39666eb8877cd93d9a7f7a012ac0000000100000fa2
 environment variable is set to true, then commands such
	as 'git blame' (in incremental mode), 'git rev-list', 'git log',
	'git check-attr' and 'git check-ignore' will
	force a flush of the output stream after each record have been
	flushed. If this
	variable is set to false, the output of these commands will be done
	using completely buffered I/O.   If this environment variable is
	not set, Git will choose buffered or record-oriented flushing
	based on whether stdout appears to be redirected to a file or not.

`GIT_TRACE`::
	Enables general trace messages, e.g. alias expansion, built-in
	command execution and external command execution.
+
If this variable is set to "1", "2" or "true" (comparison
is case insensitive), trace messages will be printed to
stderr.
+
If the variable is set to an integer value greater than 2
and lower than 10 (strictly) then Git will interpret this
value as an open file descriptor and will try to write the
trace messages into this file descriptor.
+
Alternatively, if the variable is set to an absolute path
(starting with a '/' character), Git will interpret this
as a file path and will try to append the trace messages
to it.
+
Unsetting the variable, or setting it to empty, "0" or
"false" (case insensitive) disables trace messages.

`GIT_TRACE_FSMONITOR`::
	Enables trace messages for the filesystem monitor extension.
	See `GIT_TRACE` for available trace output options.

`GIT_TRACE_PACK_ACCESS`::
	Enables trace messages for all accesses to any packs. For each
	access, the pack file name and an offset in the pack is
	recorded. This may be helpful for troubleshooting some
	pack-related performance problems.
	See `GIT_TRACE` for available trace output options.

`GIT_TRACE_PACKET`::
	Enables trace messages for all packets coming in or out of a
	given program. This can help with debugging object negotiation
	or other protocol issues. Tracing is turned off at a packet
	starting with "PACK" (but see `GIT_TRACE_PACKFILE` below).
	See `GIT_TRACE` for available trace output options.

`GIT_TRACE_PACKFILE`::
	Enables tracing of packfiles sent or received by a
	given program. Unlike other trace output, this trace is
	verbatim: no headers, and no quoting of binary data. You almost
	certainly want to direct into a file (e.g.,
	`GIT_TRACE_PACKFILE=/tmp/my.pack`) rather than displaying it on
	the terminal or mixing it with other trace output.
+
Note that this is currently only implemented for the client side
of clones and fetches.

`GIT_TRACE_PERFORMANCE`::
	Enables performance related trace messages, e.g. total execution
	time of each Git command.
	See `GIT_TRACE` for available trace output options.

`GIT_TRACE_REFS`::
	Enables trace messages for operations on the ref database.
	See `GIT_TRACE` for available trace output options.

`GIT_TRACE_SETUP`::
	Enables trace messages printing the .git, working tree and current
	working directory after Git has completed its setup phase.
	See `GIT_TRACE` for available trace output options.

`GIT_TRACE_SHALLOW`::
	Enables trace messages that can help debugging fetching /
	cloning of shallow repositories.
	See `GIT_TRACE` for available trace output options.

`GIT_TRACE_CURL`::
	Enables a curl full trace dump of all incoming and outgoing data,
	including descriptive information, of the git transport protocol.
	This is similar to doing curl `--trace-ascii` on the command line.
	See `GIT_TRACE` for available trace output options.

`GIT_TRACE_CURL_NO_DATA`::
	When a curl trace is enabled (see `GIT_TRACE_CURL` above), do not dump
	data (that is, only dump info lines and headers).

`GIT_TRACE2`::
	Enables more detailed trace messages from the "trace2" library.
	Output from `GIT_TRACE2` is a simple text-based format for human
	readability.
+
If this variable is set to "1", "2" or "true" (comparison
is case insensitive), trace messages will be printed to
stderr.
+
If the variable is set to an integer value greater than 2
and lower than 10 (strictly) then Git will interpret this
value as an

Title: Git Trace Environment Variables for Debugging
Summary
This section of the Git documentation covers environment variables that enable trace messages for various aspects of Git's behavior, including command execution, packet transmission, performance, and ref database operations, allowing users to debug and troubleshoot issues with Git commands and protocols.