Home Explore Blog CI



git

3rd chunk of `Documentation/git.adoc`
6e5e79e8d410550147f3afc0fd63b7a88b280940a724b9230000000100000fa0
 `<path>` then use
`git -C <path>`.

--work-tree=<path>::
	Set the path to the working tree. It can be an absolute path
	or a path relative to the current working directory.
	This can also be controlled by setting the GIT_WORK_TREE
	environment variable and the core.worktree configuration
	variable (see core.worktree in linkgit:git-config[1] for a
	more detailed discussion).

--namespace=<path>::
	Set the Git namespace.  See linkgit:gitnamespaces[7] for more
	details.  Equivalent to setting the `GIT_NAMESPACE` environment
	variable.

--bare::
	Treat the repository as a bare repository.  If GIT_DIR
	environment is not set, it is set to the current working
	directory.

--no-replace-objects::
	Do not use replacement refs to replace Git objects.
	This is equivalent to exporting the `GIT_NO_REPLACE_OBJECTS`
	environment variable with any value.
	See linkgit:git-replace[1] for more information.

--no-lazy-fetch::
	Do not fetch missing objects from the promisor remote on
	demand.  Useful together with `git cat-file -e <object>` to
	see if the object is locally available.
	This is equivalent to setting the `GIT_NO_LAZY_FETCH`
	environment variable to `1`.

--no-optional-locks::
	Do not perform optional operations that require locks. This is
	equivalent to setting the `GIT_OPTIONAL_LOCKS` to `0`.

--no-advice::
	Disable all advice hints from being printed.

--literal-pathspecs::
	Treat pathspecs literally (i.e. no globbing, no pathspec magic).
	This is equivalent to setting the `GIT_LITERAL_PATHSPECS` environment
	variable to `1`.

--glob-pathspecs::
	Add "glob" magic to all pathspec. This is equivalent to setting
	the `GIT_GLOB_PATHSPECS` environment variable to `1`. Disabling
	globbing on individual pathspecs can be done using pathspec
	magic ":(literal)"

--noglob-pathspecs::
	Add "literal" magic to all pathspec. This is equivalent to setting
	the `GIT_NOGLOB_PATHSPECS` environment variable to `1`. Enabling
	globbing on individual pathspecs can be done using pathspec
	magic ":(glob)"

--icase-pathspecs::
	Add "icase" magic to all pathspec. This is equivalent to setting
	the `GIT_ICASE_PATHSPECS` environment variable to `1`.

--list-cmds=<group>[,<group>...]::
	List commands by group. This is an internal/experimental
	option and may change or be removed in the future. Supported
	groups are: builtins, parseopt (builtin commands that use
	parse-options), main (all commands in libexec directory),
	others (all other commands in `$PATH` that have git- prefix),
	list-<category> (see categories in command-list.txt),
	nohelpers (exclude helper commands), alias and config
	(retrieve command list from config variable completion.commands)

--attr-source=<tree-ish>::
	Read gitattributes from <tree-ish> instead of the worktree. See
	linkgit:gitattributes[5]. This is equivalent to setting the
	`GIT_ATTR_SOURCE` environment variable.

GIT COMMANDS
------------

We divide Git into high level ("porcelain") commands and low level
("plumbing") commands.

High-level commands (porcelain)
-------------------------------

We separate the porcelain commands into the main commands and some
ancillary user utilities.

Main porcelain commands
~~~~~~~~~~~~~~~~~~~~~~~

include::{build_dir}/cmds-mainporcelain.adoc[]

Ancillary Commands
~~~~~~~~~~~~~~~~~~
Manipulators:

include::{build_dir}/cmds-ancillarymanipulators.adoc[]

Interrogators:

include::{build_dir}/cmds-ancillaryinterrogators.adoc[]


Interacting with Others
~~~~~~~~~~~~~~~~~~~~~~~

These commands are to interact with foreign SCM and with other
people via patch over e-mail.

include::{build_dir}/cmds-foreignscminterface.adoc[]

Reset, restore and revert
~~~~~~~~~~~~~~~~~~~~~~~~~
There are three commands with similar names: `git reset`,
`git restore` and `git revert`.

* linkgit:git-revert[1] is about making a new commit that reverts the
  changes made by other commits.

* linkgit:git-restore[1] is about restoring files in the working tree
  from either the index or another commit. This command does not

Title: Git Command-Line Options and Commands
Summary
The git command provides various options for configuration, environment variables, and repository settings, and is divided into high-level 'porcelain' commands and low-level 'plumbing' commands, including main commands, manipulators, interrogators, and commands for interacting with foreign SCMs and other people.