git.1   [plain text]


'\" t
.\"     Title: git
.\"    Author: [see the "Authors" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\"      Date: 06/01/2011
.\"    Manual: Git Manual
.\"    Source: Git 1.7.5.4
.\"  Language: English
.\"
.TH "GIT" "1" "06/01/2011" "Git 1\&.7\&.5\&.4" "Git Manual"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
git \- the stupid content tracker
.SH "SYNOPSIS"
.sp
.nf
\fIgit\fR [\-\-version] [\-\-exec\-path[=<path>]] [\-\-html\-path]
    [\-p|\-\-paginate|\-\-no\-pager] [\-\-no\-replace\-objects]
    [\-\-bare] [\-\-git\-dir=<path>] [\-\-work\-tree=<path>]
    [\-c <name>=<value>]
    [\-\-help] <command> [<args>]
.fi
.sp
.SH "DESCRIPTION"
.sp
Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high\-level operations and full access to internals\&.
.sp
See \fBgittutorial\fR(7) to get started, then see \m[blue]\fBEveryday Git\fR\m[]\&\s-2\u[1]\d\s+2 for a useful minimum set of commands, and "man git\-commandname" for documentation of each command\&. CVS users may also want to read \fBgitcvs-migration\fR(7)\&. See the \m[blue]\fBGit User\(cqs Manual\fR\m[]\&\s-2\u[2]\d\s+2 for a more in\-depth introduction\&.
.sp
The \fI<command>\fR is either a name of a Git command (see below) or an alias as defined in the configuration file (see \fBgit-config\fR(1))\&.
.sp
Formatted and hyperlinked version of the latest git documentation can be viewed at http://www\&.kernel\&.org/pub/software/scm/git/docs/\&.
.SH "OPTIONS"
.PP
\-\-version
.RS 4
Prints the git suite version that the
\fIgit\fR
program came from\&.
.RE
.PP
\-\-help
.RS 4
Prints the synopsis and a list of the most commonly used commands\&. If the option
\fI\-\-all\fR
or
\fI\-a\fR
is given then all available commands are printed\&. If a git command is named this option will bring up the manual page for that command\&.
.sp
Other options are available to control how the manual page is displayed\&. See
\fBgit-help\fR(1)
for more information, because
git \-\-help \&...
is converted internally into
git help \&...\&.
.RE
.PP
\-c <name>=<value>
.RS 4
Pass a configuration parameter to the command\&. The value given will override values from configuration files\&. The <name> is expected in the same format as listed by
\fIgit config\fR
(subkeys separated by dots)\&.
.RE
.PP
\-\-exec\-path[=<path>]
.RS 4
Path to wherever your core git programs are installed\&. This can also be controlled by setting the GIT_EXEC_PATH environment variable\&. If no path is given,
\fIgit\fR
will print the current setting and then exit\&.
.RE
.PP
\-\-html\-path
.RS 4
Print the path to wherever your git HTML documentation is installed and exit\&.
.RE
.PP
\-p, \-\-paginate
.RS 4
Pipe all output into
\fIless\fR
(or if set, $PAGER) if standard output is a terminal\&. This overrides the
pager\&.<cmd>
configuration options (see the "Configuration Mechanism" section below)\&.
.RE
.PP
\-\-no\-pager
.RS 4
Do not pipe git output into a pager\&.
.RE
.PP
\-\-git\-dir=<path>
.RS 4
Set the path to the repository\&. This can also be controlled by setting the GIT_DIR environment variable\&. It can be an absolute path or relative path to current working directory\&.
.RE
.PP
\-\-work\-tree=<path>
.RS 4
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
\fBgit-config\fR(1)
for a more detailed discussion)\&.
.RE
.PP
\-\-bare
.RS 4
Treat the repository as a bare repository\&. If GIT_DIR environment is not set, it is set to the current working directory\&.
.RE
.PP
\-\-no\-replace\-objects
.RS 4
Do not use replacement refs to replace git objects\&. See
\fBgit-replace\fR(1)
for more information\&.
.RE
.SH "FURTHER DOCUMENTATION"
.sp
See the references above to get started using git\&. The following is probably more detail than necessary for a first\-time user\&.
.sp
The \m[blue]\fBgit concepts chapter of the user\-manual\fR\m[]\&\s-2\u[3]\d\s+2 and \fBgitcore-tutorial\fR(7) both provide introductions to the underlying git architecture\&.
.sp
See \fBgitworkflows\fR(7) for an overview of recommended workflows\&.
.sp
See also the \m[blue]\fBhowto\fR\m[]\&\s-2\u[4]\d\s+2 documents for some useful examples\&.
.sp
The internals are documented in the \m[blue]\fBGIT API documentation\fR\m[]\&\s-2\u[5]\d\s+2\&.
.SH "GIT COMMANDS"
.sp
We divide git into high level ("porcelain") commands and low level ("plumbing") commands\&.
.SH "HIGH-LEVEL COMMANDS (PORCELAIN)"
.sp
We separate the porcelain commands into the main commands and some ancillary user utilities\&.
.SS "Main porcelain commands"
.PP
\fBgit-add\fR(1)
.RS 4
Add file contents to the index\&.
.RE
.PP
\fBgit-am\fR(1)
.RS 4
Apply a series of patches from a mailbox\&.
.RE
.PP
\fBgit-archive\fR(1)
.RS 4
Create an archive of files from a named tree\&.
.RE
.PP
\fBgit-bisect\fR(1)
.RS 4
Find by binary search the change that introduced a bug\&.
.RE
.PP
\fBgit-branch\fR(1)
.RS 4
List, create, or delete branches\&.
.RE
.PP
\fBgit-bundle\fR(1)
.RS 4
Move objects and refs by archive\&.
.RE
.PP
\fBgit-checkout\fR(1)
.RS 4
Checkout a branch or paths to the working tree\&.
.RE
.PP
\fBgit-cherry-pick\fR(1)
.RS 4
Apply the changes introduced by some existing commits\&.
.RE
.PP
\fBgit-citool\fR(1)
.RS 4
Graphical alternative to git\-commit\&.
.RE
.PP
\fBgit-clean\fR(1)
.RS 4
Remove untracked files from the working tree\&.
.RE
.PP
\fBgit-clone\fR(1)
.RS 4
Clone a repository into a new directory\&.
.RE
.PP
\fBgit-commit\fR(1)
.RS 4
Record changes to the repository\&.
.RE
.PP
\fBgit-describe\fR(1)
.RS 4
Show the most recent tag that is reachable from a commit\&.
.RE
.PP
\fBgit-diff\fR(1)
.RS 4
Show changes between commits, commit and working tree, etc\&.
.RE
.PP
\fBgit-fetch\fR(1)
.RS 4
Download objects and refs from another repository\&.
.RE
.PP
\fBgit-format-patch\fR(1)
.RS 4
Prepare patches for e\-mail submission\&.
.RE
.PP
\fBgit-gc\fR(1)
.RS 4
Cleanup unnecessary files and optimize the local repository\&.
.RE
.PP
\fBgit-grep\fR(1)
.RS 4
Print lines matching a pattern\&.
.RE
.PP
\fBgit-gui\fR(1)
.RS 4
A portable graphical interface to Git\&.
.RE
.PP
\fBgit-init\fR(1)
.RS 4
Create an empty git repository or reinitialize an existing one\&.
.RE
.PP
\fBgit-log\fR(1)
.RS 4
Show commit logs\&.
.RE
.PP
\fBgit-merge\fR(1)
.RS 4
Join two or more development histories together\&.
.RE
.PP
\fBgit-mv\fR(1)
.RS 4
Move or rename a file, a directory, or a symlink\&.
.RE
.PP
\fBgit-notes\fR(1)
.RS 4
Add or inspect object notes\&.
.RE
.PP
\fBgit-pull\fR(1)
.RS 4
Fetch from and merge with another repository or a local branch\&.
.RE
.PP
\fBgit-push\fR(1)
.RS 4
Update remote refs along with associated objects\&.
.RE
.PP
\fBgit-rebase\fR(1)
.RS 4
Forward\-port local commits to the updated upstream head\&.
.RE
.PP
\fBgit-reset\fR(1)
.RS 4
Reset current HEAD to the specified state\&.
.RE
.PP
\fBgit-revert\fR(1)
.RS 4
Revert some existing commits\&.
.RE
.PP
\fBgit-rm\fR(1)
.RS 4
Remove files from the working tree and from the index\&.
.RE
.PP
\fBgit-shortlog\fR(1)
.RS 4
Summarize
\fIgit log\fR
output\&.
.RE
.PP
\fBgit-show\fR(1)
.RS 4
Show various types of objects\&.
.RE
.PP
\fBgit-stash\fR(1)
.RS 4
Stash the changes in a dirty working directory away\&.
.RE
.PP
\fBgit-status\fR(1)
.RS 4
Show the working tree status\&.
.RE
.PP
\fBgit-submodule\fR(1)
.RS 4
Initialize, update or inspect submodules\&.
.RE
.PP
\fBgit-tag\fR(1)
.RS 4
Create, list, delete or verify a tag object signed with GPG\&.
.RE
.PP
\fBgitk\fR(1)
.RS 4
The git repository browser\&.
.RE
.SS "Ancillary Commands"
.sp
Manipulators:
.PP
\fBgit-config\fR(1)
.RS 4
Get and set repository or global options\&.
.RE
.PP
\fBgit-fast-export\fR(1)
.RS 4
Git data exporter\&.
.RE
.PP
\fBgit-fast-import\fR(1)
.RS 4
Backend for fast Git data importers\&.
.RE
.PP
\fBgit-filter-branch\fR(1)
.RS 4
Rewrite branches\&.
.RE
.PP
\fBgit-lost-found\fR(1)
.RS 4
(deprecated) Recover lost refs that luckily have not yet been pruned\&.
.RE
.PP
\fBgit-mergetool\fR(1)
.RS 4
Run merge conflict resolution tools to resolve merge conflicts\&.
.RE
.PP
\fBgit-pack-refs\fR(1)
.RS 4
Pack heads and tags for efficient repository access\&.
.RE
.PP
\fBgit-prune\fR(1)
.RS 4
Prune all unreachable objects from the object database\&.
.RE
.PP
\fBgit-reflog\fR(1)
.RS 4
Manage reflog information\&.
.RE
.PP
\fBgit-relink\fR(1)
.RS 4
Hardlink common objects in local repositories\&.
.RE
.PP
\fBgit-remote\fR(1)
.RS 4
manage set of tracked repositories\&.
.RE
.PP
\fBgit-repack\fR(1)
.RS 4
Pack unpacked objects in a repository\&.
.RE
.PP
\fBgit-replace\fR(1)
.RS 4
Create, list, delete refs to replace objects\&.
.RE
.PP
\fBgit-repo-config\fR(1)
.RS 4
(deprecated) Get and set repository or global options\&.
.RE
.sp
Interrogators:
.PP
\fBgit-annotate\fR(1)
.RS 4
Annotate file lines with commit information\&.
.RE
.PP
\fBgit-blame\fR(1)
.RS 4
Show what revision and author last modified each line of a file\&.
.RE
.PP
\fBgit-cherry\fR(1)
.RS 4
Find commits not merged upstream\&.
.RE
.PP
\fBgit-count-objects\fR(1)
.RS 4
Count unpacked number of objects and their disk consumption\&.
.RE
.PP
\fBgit-difftool\fR(1)
.RS 4
Show changes using common diff tools\&.
.RE
.PP
\fBgit-fsck\fR(1)
.RS 4
Verifies the connectivity and validity of the objects in the database\&.
.RE
.PP
\fBgit-get-tar-commit-id\fR(1)
.RS 4
Extract commit ID from an archive created using git\-archive\&.
.RE
.PP
\fBgit-help\fR(1)
.RS 4
display help information about git\&.
.RE
.PP
\fBgit-instaweb\fR(1)
.RS 4
Instantly browse your working repository in gitweb\&.
.RE
.PP
\fBgit-merge-tree\fR(1)
.RS 4
Show three\-way merge without touching index\&.
.RE
.PP
\fBgit-rerere\fR(1)
.RS 4
Reuse recorded resolution of conflicted merges\&.
.RE
.PP
\fBgit-rev-parse\fR(1)
.RS 4
Pick out and massage parameters\&.
.RE
.PP
\fBgit-show-branch\fR(1)
.RS 4
Show branches and their commits\&.
.RE
.PP
\fBgit-verify-tag\fR(1)
.RS 4
Check the GPG signature of tags\&.
.RE
.PP
\fBgit-whatchanged\fR(1)
.RS 4
Show logs with difference each commit introduces\&.
.RE
.SS "Interacting with Others"
.sp
These commands are to interact with foreign SCM and with other people via patch over e\-mail\&.
.PP
\fBgit-archimport\fR(1)
.RS 4
Import an Arch repository into git\&.
.RE
.PP
\fBgit-cvsexportcommit\fR(1)
.RS 4
Export a single commit to a CVS checkout\&.
.RE
.PP
\fBgit-cvsimport\fR(1)
.RS 4
Salvage your data out of another SCM people love to hate\&.
.RE
.PP
\fBgit-cvsserver\fR(1)
.RS 4
A CVS server emulator for git\&.
.RE
.PP
\fBgit-imap-send\fR(1)
.RS 4
Send a collection of patches from stdin to an IMAP folder\&.
.RE
.PP
\fBgit-quiltimport\fR(1)
.RS 4
Applies a quilt patchset onto the current branch\&.
.RE
.PP
\fBgit-request-pull\fR(1)
.RS 4
Generates a summary of pending changes\&.
.RE
.PP
\fBgit-send-email\fR(1)
.RS 4
Send a collection of patches as emails\&.
.RE
.PP
\fBgit-svn\fR(1)
.RS 4
Bidirectional operation between a Subversion repository and git\&.
.RE
.SH "LOW-LEVEL COMMANDS (PLUMBING)"
.sp
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 \fBgit-update-index\fR(1) and \fBgit-read-tree\fR(1)\&.
.sp
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\&.
.sp
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\&.
.SS "Manipulation commands"
.PP
\fBgit-apply\fR(1)
.RS 4
Apply a patch to files and/or to the index\&.
.RE
.PP
\fBgit-checkout-index\fR(1)
.RS 4
Copy files from the index to the working tree\&.
.RE
.PP
\fBgit-commit-tree\fR(1)
.RS 4
Create a new commit object\&.
.RE
.PP
\fBgit-hash-object\fR(1)
.RS 4
Compute object ID and optionally creates a blob from a file\&.
.RE
.PP
\fBgit-index-pack\fR(1)
.RS 4
Build pack index file for an existing packed archive\&.
.RE
.PP
\fBgit-merge-file\fR(1)
.RS 4
Run a three\-way file merge\&.
.RE
.PP
\fBgit-merge-index\fR(1)
.RS 4
Run a merge for files needing merging\&.
.RE
.PP
\fBgit-mktag\fR(1)
.RS 4
Creates a tag object\&.
.RE
.PP
\fBgit-mktree\fR(1)
.RS 4
Build a tree\-object from ls\-tree formatted text\&.
.RE
.PP
\fBgit-pack-objects\fR(1)
.RS 4
Create a packed archive of objects\&.
.RE
.PP
\fBgit-prune-packed\fR(1)
.RS 4
Remove extra objects that are already in pack files\&.
.RE
.PP
\fBgit-read-tree\fR(1)
.RS 4
Reads tree information into the index\&.
.RE
.PP
\fBgit-symbolic-ref\fR(1)
.RS 4
Read and modify symbolic refs\&.
.RE
.PP
\fBgit-unpack-objects\fR(1)
.RS 4
Unpack objects from a packed archive\&.
.RE
.PP
\fBgit-update-index\fR(1)
.RS 4
Register file contents in the working tree to the index\&.
.RE
.PP
\fBgit-update-ref\fR(1)
.RS 4
Update the object name stored in a ref safely\&.
.RE
.PP
\fBgit-write-tree\fR(1)
.RS 4
Create a tree object from the current index\&.
.RE
.SS "Interrogation commands"
.PP
\fBgit-cat-file\fR(1)
.RS 4
Provide content or type and size information for repository objects\&.
.RE
.PP
\fBgit-diff-files\fR(1)
.RS 4
Compares files in the working tree and the index\&.
.RE
.PP
\fBgit-diff-index\fR(1)
.RS 4
Compares content and mode of blobs between the index and repository\&.
.RE
.PP
\fBgit-diff-tree\fR(1)
.RS 4
Compares the content and mode of blobs found via two tree objects\&.
.RE
.PP
\fBgit-for-each-ref\fR(1)
.RS 4
Output information on each ref\&.
.RE
.PP
\fBgit-ls-files\fR(1)
.RS 4
Show information about files in the index and the working tree\&.
.RE
.PP
\fBgit-ls-remote\fR(1)
.RS 4
List references in a remote repository\&.
.RE
.PP
\fBgit-ls-tree\fR(1)
.RS 4
List the contents of a tree object\&.
.RE
.PP
\fBgit-merge-base\fR(1)
.RS 4
Find as good common ancestors as possible for a merge\&.
.RE
.PP
\fBgit-name-rev\fR(1)
.RS 4
Find symbolic names for given revs\&.
.RE
.PP
\fBgit-pack-redundant\fR(1)
.RS 4
Find redundant pack files\&.
.RE
.PP
\fBgit-rev-list\fR(1)
.RS 4
Lists commit objects in reverse chronological order\&.
.RE
.PP
\fBgit-show-index\fR(1)
.RS 4
Show packed archive index\&.
.RE
.PP
\fBgit-show-ref\fR(1)
.RS 4
List references in a local repository\&.
.RE
.PP
\fBgit-tar-tree\fR(1)
.RS 4
(deprecated) Create a tar archive of the files in the named tree object\&.
.RE
.PP
\fBgit-unpack-file\fR(1)
.RS 4
Creates a temporary file with a blob\(cqs contents\&.
.RE
.PP
\fBgit-var\fR(1)
.RS 4
Show a git logical variable\&.
.RE
.PP
\fBgit-verify-pack\fR(1)
.RS 4
Validate packed git archive files\&.
.RE
.sp
In general, the interrogate commands do not touch the files in the working tree\&.
.SS "Synching repositories"
.PP
\fBgit-daemon\fR(1)
.RS 4
A really simple server for git repositories\&.
.RE
.PP
\fBgit-fetch-pack\fR(1)
.RS 4
Receive missing objects from another repository\&.
.RE
.PP
\fBgit-http-backend\fR(1)
.RS 4
Server side implementation of Git over HTTP\&.
.RE
.PP
\fBgit-send-pack\fR(1)
.RS 4
Push objects over git protocol to another repository\&.
.RE
.PP
\fBgit-update-server-info\fR(1)
.RS 4
Update auxiliary info file to help dumb servers\&.
.RE
.sp
The following are helper commands used by the above; end users typically do not use them directly\&.
.PP
\fBgit-http-fetch\fR(1)
.RS 4
Download from a remote git repository via HTTP\&.
.RE
.PP
\fBgit-http-push\fR(1)
.RS 4
Push objects over HTTP/DAV to another repository\&.
.RE
.PP
\fBgit-parse-remote\fR(1)
.RS 4
Routines to help parsing remote repository access parameters\&.
.RE
.PP
\fBgit-receive-pack\fR(1)
.RS 4
Receive what is pushed into the repository\&.
.RE
.PP
\fBgit-shell\fR(1)
.RS 4
Restricted login shell for Git\-only SSH access\&.
.RE
.PP
\fBgit-upload-archive\fR(1)
.RS 4
Send archive back to git\-archive\&.
.RE
.PP
\fBgit-upload-pack\fR(1)
.RS 4
Send objects packed back to git\-fetch\-pack\&.
.RE
.SS "Internal helper commands"
.sp
These are internal helper commands used by other commands; end users typically do not use them directly\&.
.PP
\fBgit-check-attr\fR(1)
.RS 4
Display gitattributes information\&.
.RE
.PP
\fBgit-check-ref-format\fR(1)
.RS 4
Ensures that a reference name is well formed\&.
.RE
.PP
\fBgit-fmt-merge-msg\fR(1)
.RS 4
Produce a merge commit message\&.
.RE
.PP
\fBgit-mailinfo\fR(1)
.RS 4
Extracts patch and authorship from a single e\-mail message\&.
.RE
.PP
\fBgit-mailsplit\fR(1)
.RS 4
Simple UNIX mbox splitter program\&.
.RE
.PP
\fBgit-merge-one-file\fR(1)
.RS 4
The standard helper program to use with git\-merge\-index\&.
.RE
.PP
\fBgit-patch-id\fR(1)
.RS 4
Compute unique ID for a patch\&.
.RE
.PP
\fBgit-peek-remote\fR(1)
.RS 4
(deprecated) List the references in a remote repository\&.
.RE
.PP
\fBgit-sh-setup\fR(1)
.RS 4
Common git shell script setup code\&.
.RE
.PP
\fBgit-stripspace\fR(1)
.RS 4
Filter out empty lines\&.
.RE
.SH "CONFIGURATION MECHANISM"
.sp
Starting from 0\&.99\&.9 (actually mid 0\&.99\&.8\&.GIT), \&.git/config file is used to hold per\-repository configuration options\&. It is a simple text file modeled after \&.ini format familiar to some people\&. Here is an example:
.sp
.if n \{\
.RS 4
.\}
.nf
#
# A \(aq#\(aq or \(aq;\(aq character indicates a comment\&.
#

; core variables
[core]
        ; Don\(aqt trust file modes
        filemode = false

; user identity
[user]
        name = "Junio C Hamano"
        email = "junkio@twinsun\&.com"
.fi
.if n \{\
.RE
.\}
.sp
.sp
Various commands read from the configuration file and adjust their operation accordingly\&. See \fBgit-config\fR(1) for a list\&.
.SH "IDENTIFIER TERMINOLOGY"
.PP
<object>
.RS 4
Indicates the object name for any type of object\&.
.RE
.PP
<blob>
.RS 4
Indicates a blob object name\&.
.RE
.PP
<tree>
.RS 4
Indicates a tree object name\&.
.RE
.PP
<commit>
.RS 4
Indicates a commit object name\&.
.RE
.PP
<tree\-ish>
.RS 4
Indicates a tree, commit or tag object name\&. A command that takes a <tree\-ish> argument ultimately wants to operate on a <tree> object but automatically dereferences <commit> and <tag> objects that point at a <tree>\&.
.RE
.PP
<commit\-ish>
.RS 4
Indicates a commit or tag object name\&. A command that takes a <commit\-ish> argument ultimately wants to operate on a <commit> object but automatically dereferences <tag> objects that point at a <commit>\&.
.RE
.PP
<type>
.RS 4
Indicates that an object type is required\&. Currently one of:
blob,
tree,
commit, or
tag\&.
.RE
.PP
<file>
.RS 4
Indicates a filename \- almost always relative to the root of the tree structure
GIT_INDEX_FILE
describes\&.
.RE
.SH "SYMBOLIC IDENTIFIERS"
.sp
Any git command accepting any <object> can also use the following symbolic notation:
.PP
HEAD
.RS 4
indicates the head of the current branch (i\&.e\&. the contents of
$GIT_DIR/HEAD)\&.
.RE
.PP
<tag>
.RS 4
a valid tag
\fIname\fR
(i\&.e\&. the contents of
$GIT_DIR/refs/tags/<tag>)\&.
.RE
.PP
<head>
.RS 4
a valid head
\fIname\fR
(i\&.e\&. the contents of
$GIT_DIR/refs/heads/<head>)\&.
.RE
.sp
For a more complete list of ways to spell object names, see "SPECIFYING REVISIONS" section in \fBgitrevisions\fR(7)\&.
.SH "FILE/DIRECTORY STRUCTURE"
.sp
Please see the \fBgitrepository-layout\fR(5) document\&.
.sp
Read \fBgithooks\fR(5) for more details about each hook\&.
.sp
Higher level SCMs may provide and manage additional information in the $GIT_DIR\&.
.SH "TERMINOLOGY"
.sp
Please see \fBgitglossary\fR(7)\&.
.SH "ENVIRONMENT VARIABLES"
.sp
Various git commands use the following environment variables:
.SS "The git Repository"
.sp
These environment variables apply to \fIall\fR core git commands\&. Nb: it is worth noting that they may be used/overridden by SCMS sitting above git so take care if using Cogito etc\&.
.PP
\fIGIT_INDEX_FILE\fR
.RS 4
This environment allows the specification of an alternate index file\&. If not specified, the default of
$GIT_DIR/index
is used\&.
.RE
.PP
\fIGIT_OBJECT_DIRECTORY\fR
.RS 4
If the object storage directory is specified via this environment variable then the sha1 directories are created underneath \- otherwise the default
$GIT_DIR/objects
directory is used\&.
.RE
.PP
\fIGIT_ALTERNATE_OBJECT_DIRECTORIES\fR
.RS 4
Due to the immutable nature of git objects, old objects can be archived into shared, read\-only directories\&. This variable specifies a ":" separated (on Windows ";" separated) list of git object directories which can be used to search for git objects\&. New objects will not be written to these directories\&.
.RE
.PP
\fIGIT_DIR\fR
.RS 4
If the
\fIGIT_DIR\fR
environment variable is set then it specifies a path to use instead of the default
\&.git
for the base of the repository\&.
.RE
.PP
\fIGIT_WORK_TREE\fR
.RS 4
Set the path to the working tree\&. The value will not be used in combination with repositories found automatically in a \&.git directory (i\&.e\&. $GIT_DIR is not set)\&. This can also be controlled by the
\fI\-\-work\-tree\fR
command line option and the core\&.worktree configuration variable\&.
.RE
.PP
\fIGIT_CEILING_DIRECTORIES\fR
.RS 4
This should be a colon\-separated list of absolute paths\&. If set, it is a list of directories that git should not chdir up into while looking for a repository directory\&. It will not exclude the current working directory or a GIT_DIR set on the command line or in the environment\&. (Useful for excluding slow\-loading network directories\&.)
.RE
.PP
\fIGIT_DISCOVERY_ACROSS_FILESYSTEM\fR
.RS 4
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 environment variable can be set to true to tell git not to stop at filesystem boundaries\&. Like
\fIGIT_CEILING_DIRECTORIES\fR, this will not affect an explicit repository directory set via
\fIGIT_DIR\fR
or on the command line\&.
.RE
.SS "git Commits"
.PP
\fIGIT_AUTHOR_NAME\fR, \fIGIT_AUTHOR_EMAIL\fR, \fIGIT_AUTHOR_DATE\fR, \fIGIT_COMMITTER_NAME\fR, \fIGIT_COMMITTER_EMAIL\fR, \fIGIT_COMMITTER_DATE\fR, \fIEMAIL\fR
.RS 4
see
\fBgit-commit-tree\fR(1)
.RE
.SS "git Diffs"
.PP
\fIGIT_DIFF_OPTS\fR
.RS 4
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\&.
.RE
.PP
\fIGIT_EXTERNAL_DIFF\fR
.RS 4
When the environment variable
\fIGIT_EXTERNAL_DIFF\fR
is set, the program named by it is called, instead of the diff invocation described above\&. For a path that is added, removed, or modified,
\fIGIT_EXTERNAL_DIFF\fR
is called with 7 parameters:
.sp
.if n \{\
.RS 4
.\}
.nf
path old\-file old\-hex old\-mode new\-file new\-hex new\-mode
.fi
.if n \{\
.RE
.\}
.sp
where:
.RE
.PP
<old|new>\-file
.RS 4
are files GIT_EXTERNAL_DIFF can use to read the contents of <old|new>,
.RE
.PP
<old|new>\-hex
.RS 4
are the 40\-hexdigit SHA1 hashes,
.RE
.PP
<old|new>\-mode
.RS 4
are the octal representation of the file modes\&.
.sp
The file parameters can point at the user\(cqs 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)\&.
\fIGIT_EXTERNAL_DIFF\fR
should not worry about unlinking the temporary file \-\-\- it is removed when
\fIGIT_EXTERNAL_DIFF\fR
exits\&.
.sp
For a path that is unmerged,
\fIGIT_EXTERNAL_DIFF\fR
is called with 1 parameter, <path>\&.
.RE
.SS "other"
.PP
\fIGIT_MERGE_VERBOSITY\fR
.RS 4
A number controlling the amount of output shown by the recursive merge strategy\&. Overrides merge\&.verbosity\&. See
\fBgit-merge\fR(1)
.RE
.PP
\fIGIT_PAGER\fR
.RS 4
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
\fBgit-config\fR(1)\&.
.RE
.PP
\fIGIT_SSH\fR
.RS 4
If this environment variable is set then
\fIgit fetch\fR
and
\fIgit push\fR
will use this command instead of
\fIssh\fR
when they need to connect to a remote system\&. The
\fI$GIT_SSH\fR
command will be given exactly two arguments: the
\fIusername@host\fR
(or just
\fIhost\fR) from the URL and the shell command to execute on that remote system\&.
.sp
To pass options to the program that you want to list in GIT_SSH you will need to wrap the program and options into a shell script, then set GIT_SSH to refer to the shell script\&.
.sp
Usually it is easier to configure any desired options through your personal
\&.ssh/config
file\&. Please consult your ssh documentation for further details\&.
.RE
.PP
\fIGIT_ASKPASS\fR
.RS 4
If this environment variable is set, then git commands which need to acquire passwords or passphrases (e\&.g\&. for HTTP or IMAP authentication) will call this program with a suitable prompt as command line argument and read the password from its STDOUT\&. See also the
\fIcore\&.askpass\fR
option in
\fBgit-config\fR(1)\&.
.RE
.PP
\fIGIT_FLUSH\fR
.RS 4
If this environment variable is set to "1", then commands such as
\fIgit blame\fR
(in incremental mode),
\fIgit rev\-list\fR,
\fIgit log\fR, and
\fIgit whatchanged\fR
will force a flush of the output stream after each commit\-oriented record have been flushed\&. If this variable is set to "0", the output of these commands will be done using completely buffered I/O\&. If this environment variable is not set, git will choose buffered or record\-oriented flushing based on whether stdout appears to be redirected to a file or not\&.
.RE
.PP
\fIGIT_TRACE\fR
.RS 4
If this variable is set to "1", "2" or "true" (comparison is case insensitive), git will print
trace:
messages on stderr telling about alias expansion, built\-in command execution and external command execution\&. If this variable is set to an integer value greater than 1 and lower than 10 (strictly) then git will interpret this value as an open file descriptor and will try to write the trace messages into this file descriptor\&. Alternatively, if this variable is set to an absolute path (starting with a
\fI/\fR
character), git will interpret this as a file path and will try to write the trace messages into it\&.
.RE
.SH "DISCUSSION"
.sp
More detail on the following is available from the \m[blue]\fBgit concepts chapter of the user\-manual\fR\m[]\&\s-2\u[3]\d\s+2 and \fBgitcore-tutorial\fR(7)\&.
.sp
A git project normally consists of a working directory with a "\&.git" subdirectory at the top level\&. The \&.git directory contains, among other things, a compressed object database representing the complete history of the project, an "index" file which links that history to the current contents of the working tree, and named pointers into that history such as tags and branch heads\&.
.sp
The object database contains objects of three main types: blobs, which hold file data; trees, which point to blobs and other trees to build up directory hierarchies; and commits, which each reference a single tree and some number of parent commits\&.
.sp
The commit, equivalent to what other systems call a "changeset" or "version", represents a step in the project\(cqs history, and each parent represents an immediately preceding step\&. Commits with more than one parent represent merges of independent lines of development\&.
.sp
All objects are named by the SHA1 hash of their contents, normally written as a string of 40 hex digits\&. Such names are globally unique\&. The entire history leading up to a commit can be vouched for by signing just that commit\&. A fourth object type, the tag, is provided for this purpose\&.
.sp
When first created, objects are stored in individual files, but for efficiency may later be compressed together into "pack files"\&.
.sp
Named pointers called refs mark interesting points in history\&. A ref may contain the SHA1 name of an object or the name of another ref\&. Refs with names beginning ref/head/ contain the SHA1 name of the most recent commit (or "head") of a branch under development\&. SHA1 names of tags of interest are stored under ref/tags/\&. A special ref named HEAD contains the name of the currently checked\-out branch\&.
.sp
The index file is initialized with a list of all paths and, for each path, a blob object and a set of attributes\&. The blob object represents the contents of the file as of the head of the current branch\&. The attributes (last modified time, size, etc\&.) are taken from the corresponding file in the working tree\&. Subsequent changes to the working tree can be found by comparing these attributes\&. The index may be updated with new content, and new commits may be created from the content stored in the index\&.
.sp
The index is also capable of storing multiple entries (called "stages") for a given pathname\&. These stages are used to hold the various unmerged version of a file when a merge is in progress\&.
.SH "AUTHORS"
.sp
Git was started by Linus Torvalds, and is currently maintained by Junio C Hamano\&. Numerous contributions have come from the git mailing list <\m[blue]\fBgit@vger\&.kernel\&.org\fR\m[]\&\s-2\u[6]\d\s+2>\&. For a more complete list of contributors, see \m[blue]\fBhttp://git\-scm\&.com/about\fR\m[]\&. If you have a clone of git\&.git itself, the output of \fBgit-shortlog\fR(1) and \fBgit-blame\fR(1) can show you the authors for specific parts of the project\&.
.SH "REPORTING BUGS"
.sp
Report bugs to the Git mailing list <\m[blue]\fBgit@vger\&.kernel\&.org\fR\m[]\&\s-2\u[6]\d\s+2> where the development and maintenance is primarily done\&. You do not have to be subscribed to the list to send a message there\&.
.SH "SEE ALSO"
.sp
\fBgittutorial\fR(7), \fBgittutorial-2\fR(7), \m[blue]\fBEveryday Git\fR\m[]\&\s-2\u[1]\d\s+2, \fBgitcvs-migration\fR(7), \fBgitglossary\fR(7), \fBgitcore-tutorial\fR(7), \fBgitcli\fR(7), \m[blue]\fBThe Git User\(cqs Manual\fR\m[]\&\s-2\u[2]\d\s+2, \fBgitworkflows\fR(7)
.SH "GIT"
.sp
Part of the \fBgit\fR(1) suite
.SH "NOTES"
.IP " 1." 4
Everyday Git
.RS 4
\%http://www.kernel.org/pub/software/scm/git/docs/everyday.html
.RE
.IP " 2." 4
Git User\(cqs Manual
.RS 4
\%http://www.kernel.org/pub/software/scm/git/docs/user-manual.html
.RE
.IP " 3." 4
git concepts chapter of the user-manual
.RS 4
\%http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#git-concepts
.RE
.IP " 4." 4
howto
.RS 4
\%http://www.kernel.org/pub/software/scm/git/docs/howto-index.html
.RE
.IP " 5." 4
GIT API documentation
.RS 4
\%http://www.kernel.org/pub/software/scm/git/docs/technical/api-index.html
.RE
.IP " 6." 4
git@vger.kernel.org
.RS 4
\%mailto:git@vger.kernel.org
.RE