Home Explore Blog CI



git

4th chunk of `Documentation/git.adoc`
cf5ec5ecf2f851de2597b806ed4c31b19875a9f5510acc120000000100000fa9
 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
  update your branch. The command can also be used to restore files in
  the index from another commit.

* linkgit:git-reset[1] is about updating your branch, moving the tip
  in order to add or remove commits from the branch. This operation
  changes the commit history.
+
`git reset` can also be used to restore the index, overlapping with
`git restore`.


Low-level commands (plumbing)
-----------------------------

Although Git includes its
own porcelain layer, its low-level commands are sufficient to support
development of alternative porcelains.  Developers of such porcelains
might start by reading about linkgit:git-update-index[1] and
linkgit:git-read-tree[1].

The interface (input, output, set of options and the semantics)
to these low-level commands are meant to be a lot more stable
than Porcelain level commands, because these commands are
primarily for scripted use.  The interface to Porcelain commands
on the other hand are subject to change in order to improve the
end user experience.

The following description divides
the low-level commands into commands that manipulate objects (in
the repository, index, and working tree), commands that interrogate and
compare objects, and commands that move objects and references between
repositories.


Manipulation commands
~~~~~~~~~~~~~~~~~~~~~

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


Interrogation commands
~~~~~~~~~~~~~~~~~~~~~~

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

In general, the interrogate commands do not touch the files in
the working tree.


Syncing repositories
~~~~~~~~~~~~~~~~~~~~

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

The following are helper commands used by the above; end users
typically do not use them directly.

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


Internal helper commands
~~~~~~~~~~~~~~~~~~~~~~~~

These are internal helper commands used by other commands; end
users typically do not use them directly.

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

Guides
------

The following documentation pages are guides about Git concepts.

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

Repository, command and file interfaces
---------------------------------------

This documentation discusses repository and command interfaces which
users are expected to interact with directly. See `--user-formats` in
linkgit:git-help[1] for more details on the criteria.

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

File formats, protocols and other developer interfaces
------------------------------------------------------

This documentation discusses file formats, over-the-wire protocols and
other git developer interfaces. See `--developer-interfaces` in
linkgit:git-help[1].

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

Configuration Mechanism
-----------------------

Git uses a simple text format to store customizations that are per
repository and are per user.  Such a configuration file may look
like this:

------------
#
# A '#' or ';' character

Title: Git Commands and Interfaces
Summary
Git is divided into high-level 'porcelain' commands and low-level 'plumbing' commands, with porcelain commands including main commands, manipulators, and interrogators, while plumbing commands include manipulation, interrogation, and syncing commands, as well as internal helper commands and guides for Git concepts and interfaces.