Home Explore Blog CI



git

7th chunk of `Documentation/git.adoc`
05f9345e001123c04b0fd12b5ae84339a12d68c5d0df347c0000000100000fac
 It will not
	exclude the current working directory or a GIT_DIR set on the
	command line or in the environment.  Normally, Git has to read
	the entries in this list and resolve any symlink that
	might be present in order to compare them with the current
	directory.  However, if even this access is slow, you
	can add an empty entry to the list to tell Git that the
	subsequent entries are not symlinks and needn't be resolved;
	e.g.,
	`GIT_CEILING_DIRECTORIES=/maybe/symlink::/very/slow/non/symlink`.

`GIT_DISCOVERY_ACROSS_FILESYSTEM`::
	When run in a directory that does not have ".git" repository
	directory, Git tries to find such a directory in the parent
	directories to find the top of the working tree, but by default it
	does not cross filesystem boundaries.  This Boolean environment variable
	can be set to true to tell Git not to stop at filesystem
	boundaries.  Like `GIT_CEILING_DIRECTORIES`, this will not affect
	an explicit repository directory set via `GIT_DIR` or on the
	command line.

`GIT_COMMON_DIR`::
	If this variable is set to a path, non-worktree files that are
	normally in $GIT_DIR will be taken from this path
	instead. Worktree-specific files such as HEAD or index are
	taken from $GIT_DIR. See linkgit:gitrepository-layout[5] and
	linkgit:git-worktree[1] for
	details. This variable has lower precedence than other path
	variables such as GIT_INDEX_FILE, GIT_OBJECT_DIRECTORY...

`GIT_DEFAULT_HASH`::
	If this variable is set, the default hash algorithm for new
	repositories will be set to this value. This value is
	ignored when cloning and the setting of the remote repository
	is always used. The default is "sha1".
	See `--object-format` in linkgit:git-init[1].

`GIT_DEFAULT_REF_FORMAT`::
	If this variable is set, the default reference backend format for new
	repositories will be set to this value. The default is "files".
	See `--ref-format` in linkgit:git-init[1].

Git Commits
~~~~~~~~~~~
`GIT_AUTHOR_NAME`::
	The human-readable name used in the author identity when creating commit or
	tag objects, or when writing reflogs. Overrides the `user.name` and
	`author.name` configuration settings.

`GIT_AUTHOR_EMAIL`::
	The email address used in the author identity when creating commit or
	tag objects, or when writing reflogs. Overrides the `user.email` and
	`author.email` configuration settings.

`GIT_AUTHOR_DATE`::
	The date used for the author identity when creating commit or tag objects, or
	when writing reflogs. See linkgit:git-commit[1] for valid formats.

`GIT_COMMITTER_NAME`::
	The human-readable name used in the committer identity when creating commit or
	tag objects, or when writing reflogs. Overrides the `user.name` and
	`committer.name` configuration settings.

`GIT_COMMITTER_EMAIL`::
	The email address used in the author identity when creating commit or
	tag objects, or when writing reflogs. Overrides the `user.email` and
	`committer.email` configuration settings.

`GIT_COMMITTER_DATE`::
	The date used for the committer identity when 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::

Title: Git Environment Variables for Commits, Diffs, and More
Summary
This section of the Git documentation covers environment variables that control various aspects of Git's behavior, including commit and tag creation, diff generation, and repository discovery, providing options to customize and override default settings for tasks such as author identification, date settings, and diff formatting.