Home Explore Blog CI



git

8th chunk of `Documentation/git.adoc`
6e0b4690ef4ec585fb49c04eb3fbd1eb91672b462a2432d90000000100000fa0
 creating commit or tag objects, or
	when writing reflogs. See linkgit:git-commit[1] for valid formats.

`EMAIL`::
	The email address used in the author and committer identities if no other
	relevant environment variable or configuration setting has been set.

Git Diffs
~~~~~~~~~
`GIT_DIFF_OPTS`::
	Only valid setting is "--unified=??" or "-u??" to set the
	number of context lines shown when a unified diff is created.
	This takes precedence over any "-U" or "--unified" option
	value passed on the Git diff command line.

`GIT_EXTERNAL_DIFF`::
	When the environment variable `GIT_EXTERNAL_DIFF` is set, the
	program named by it is called to generate diffs, and Git
	does not use its builtin diff machinery.
	For a path that is added, removed, or modified,
	`GIT_EXTERNAL_DIFF` is called with 7 parameters:

	path old-file old-hex old-mode new-file new-hex new-mode
+
where:

	<old|new>-file:: are files GIT_EXTERNAL_DIFF can use to read the
                         contents of <old|new>,
	<old|new>-hex:: are the 40-hexdigit SHA-1 hashes,
	<old|new>-mode:: are the octal representation of the file modes.
+
The file parameters can point at the user's working file
(e.g. `new-file` in "git-diff-files"), `/dev/null` (e.g. `old-file`
when a new file is added), or a temporary file (e.g. `old-file` in the
index).  `GIT_EXTERNAL_DIFF` should not worry about unlinking the
temporary file -- it is removed when `GIT_EXTERNAL_DIFF` exits.
+
For a path that is unmerged, `GIT_EXTERNAL_DIFF` is called with 1
parameter, <path>.
+
For each path `GIT_EXTERNAL_DIFF` is called, two environment variables,
`GIT_DIFF_PATH_COUNTER` and `GIT_DIFF_PATH_TOTAL` are set.

`GIT_EXTERNAL_DIFF_TRUST_EXIT_CODE`::
	If this Boolean environment variable is set to true then the
	`GIT_EXTERNAL_DIFF` command is expected to return exit code
	0 if it considers the input files to be equal or 1 if it
	considers them to be different, like `diff(1)`.
	If it is set to false, which is the default, then the command
	is expected to return exit code 0 regardless of equality.
	Any other exit code causes Git to report a fatal error.


`GIT_DIFF_PATH_COUNTER`::
	A 1-based counter incremented by one for every path.

`GIT_DIFF_PATH_TOTAL`::
	The total number of paths.

other
~~~~~
`GIT_MERGE_VERBOSITY`::
	A number controlling the amount of output shown by
	the recursive merge strategy.  Overrides merge.verbosity.
	See linkgit:git-merge[1]

`GIT_PAGER`::
	This environment variable overrides `$PAGER`. If it is set
	to an empty string or to the value "cat", Git will not launch
	a pager.  See also the `core.pager` option in
	linkgit:git-config[1].

`GIT_PROGRESS_DELAY`::
	A number controlling how many seconds to delay before showing
	optional progress indicators. Defaults to 2.

`GIT_EDITOR`::
	This environment variable overrides `$EDITOR` and `$VISUAL`.
	It is used by several Git commands when, on interactive mode,
	an editor is to be launched. See also linkgit:git-var[1]
	and the `core.editor` option in linkgit:git-config[1].

`GIT_SEQUENCE_EDITOR`::
	This environment variable overrides the configured Git editor
	when editing the todo list of an interactive rebase. See also
	linkgit:git-rebase[1] and the `sequence.editor` option in
	linkgit:git-config[1].

`GIT_SSH`::
`GIT_SSH_COMMAND`::
	If either of these environment variables is set then 'git fetch'
	and 'git push' will use the specified command instead of 'ssh'
	when they need to connect to a remote system.
	The command-line parameters passed to the configured command are
	determined by the ssh variant.  See `ssh.variant` option in
	linkgit:git-config[1] for details.
+
`$GIT_SSH_COMMAND` takes precedence over `$GIT_SSH`, and is interpreted
by the shell, which allows additional arguments to be included.
`$GIT_SSH` on the other hand must be just the path to a program
(which can be a wrapper shell script, if additional arguments are
needed).
+
Usually it is easier to configure any desired options through your
personal `.ssh/config` file.  Please

Title: Git Environment Variables for Diffs, Merging, and Interaction
Summary
This section of the Git documentation covers environment variables that control various aspects of Git's behavior, including diff generation, merging, interactive mode, and remote connections, providing options to customize and override default settings for tasks such as external diff tools, merge verbosity, editor selection, and SSH connections.