Home Explore Blog CI



git

12th chunk of `Documentation/git.adoc`
f30bac5d547eb357856db2c6ebf31a9c84e5c3af17833b3a0000000100000fab
	running `GIT_LITERAL_PATHSPECS=1 git log -- '*.c'` will search
	for commits that touch the path `*.c`, not any paths that the
	glob `*.c` matches. You might want this if you are feeding
	literal paths to Git (e.g., paths previously given to you by
	`git ls-tree`, `--raw` diff output, etc).

`GIT_GLOB_PATHSPECS`::
	Setting this Boolean environment variable to true will cause Git to treat all
	pathspecs as glob patterns (aka "glob" magic).

`GIT_NOGLOB_PATHSPECS`::
	Setting this Boolean environment variable to true will cause Git to treat all
	pathspecs as literal (aka "literal" magic).

`GIT_ICASE_PATHSPECS`::
	Setting this Boolean environment variable to true will cause Git to treat all
	pathspecs as case-insensitive.

`GIT_NO_LAZY_FETCH`::
	Setting this Boolean environment variable to true tells Git
	not to lazily fetch missing objects from the promisor remote
	on demand.

`GIT_REFLOG_ACTION`::
	When a ref is updated, reflog entries are created to keep
	track of the reason why the ref was updated (which is
	typically the name of the high-level command that updated
	the ref), in addition to the old and new values of the ref.
	A scripted Porcelain command can use set_reflog_action
	helper function in `git-sh-setup` to set its name to this
	variable when it is invoked as the top level command by the
	end user, to be recorded in the body of the reflog.

`GIT_REF_PARANOIA`::
	If this Boolean environment variable is set to false, ignore broken or badly named refs when iterating
	over lists of refs. Normally Git will try to include any such
	refs, which may cause some operations to fail. This is usually
	preferable, as potentially destructive operations (e.g.,
	linkgit:git-prune[1]) are better off aborting rather than
	ignoring broken refs (and thus considering the history they
	point to as not worth saving). The default value is `1` (i.e.,
	be paranoid about detecting and aborting all operations). You
	should not normally need to set this to `0`, but it may be
	useful when trying to salvage data from a corrupted repository.

`GIT_COMMIT_GRAPH_PARANOIA`::
	When loading a commit object from the commit-graph, Git performs an
	existence check on the object in the object database. This is done to
	avoid issues with stale commit-graphs that contain references to
	already-deleted commits, but comes with a performance penalty.
+
The default is "false", which disables the aforementioned behavior.
Setting this to "true" enables the existence check so that stale commits
will never be returned from the commit-graph at the cost of performance.

`GIT_ALLOW_PROTOCOL`::
	If set to a colon-separated list of protocols, behave as if
	`protocol.allow` is set to `never`, and each of the listed
	protocols has `protocol.<name>.allow` set to `always`
	(overriding any existing configuration). See the description of
	`protocol.allow` in linkgit:git-config[1] for more details.

`GIT_PROTOCOL_FROM_USER`::
	Set this Boolean environment variable to false to prevent protocols used by fetch/push/clone which are
	configured to the `user` state.  This is useful to restrict recursive
	submodule initialization from an untrusted repository or for programs
	which feed potentially-untrusted URLS to git commands.  See
	linkgit:git-config[1] for more details.

`GIT_PROTOCOL`::
	For internal use only.  Used in handshaking the wire protocol.
	Contains a colon ':' separated list of keys with optional values
	'<key>[=<value>]'.  Presence of unknown keys and values must be
	ignored.
+
Note that servers may need to be configured to allow this variable to
pass over some transports. It will be propagated automatically when
accessing local repositories (i.e., `file://` or a filesystem path), as
well as over the `git://` protocol. For git-over-http, it should work
automatically in most configurations, but see the discussion in
linkgit:git-http-backend[1]. For git-over-ssh, the ssh server may need
to be configured to allow clients to pass this variable (e.g., by using
`AcceptEnv GIT_PROTOCOL`

Title: Git Environment Variables for Pathspecs, Refs, and Protocols
Summary
This section of the Git documentation covers environment variables that customize pathspec behavior, reflog actions, and protocol settings, including variables for treating pathspecs as literals, globs, or case-insensitive, as well as variables for controlling reflog entries, commit graph paranoia, and protocol allowances.