6 git - the stupid content tracker
12 'git' [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate]
13 [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]
14 [--help] COMMAND [ARGS]
18 Git is a fast, scalable, distributed revision control system with an
19 unusually rich command set that provides both high-level operations
20 and full access to internals.
22 See this link:tutorial.html[tutorial] to get started, then see
23 link:everyday.html[Everyday Git] for a useful minimum set of commands, and
24 "man git-commandname" for documentation of each command. CVS users may
25 also want to read link:cvs-migration.html[CVS migration]. See
26 link:user-manual.html[Git User's Manual] for a more in-depth
29 The COMMAND is either a name of a Git command (see below) or an alias
30 as defined in the configuration file (see gitlink:git-config[1]).
32 Formatted and hyperlinked version of the latest git
33 documentation can be viewed at
34 `http://www.kernel.org/pub/software/scm/git/docs/`.
40 You are reading the documentation for the latest (possibly
41 unreleased) version of git, that is available from 'master'
42 branch of the `git.git` repository.
43 Documentation for older releases are available here:
45 * link:v1.5.2.2/git.html[documentation for release 1.5.2.2]
48 link:RelNotes-1.5.2.2.txt[1.5.2.2],
49 link:RelNotes-1.5.2.1.txt[1.5.2.1],
50 link:RelNotes-1.5.2.txt[1.5.2].
52 * link:v1.5.1.6/git.html[documentation for release 1.5.1.6]
55 link:RelNotes-1.5.1.6.txt[1.5.1.6],
56 link:RelNotes-1.5.1.5.txt[1.5.1.5],
57 link:RelNotes-1.5.1.4.txt[1.5.1.4],
58 link:RelNotes-1.5.1.3.txt[1.5.1.3],
59 link:RelNotes-1.5.1.2.txt[1.5.1.2],
60 link:RelNotes-1.5.1.1.txt[1.5.1.1],
61 link:RelNotes-1.5.1.txt[1.5.1].
63 * link:v1.5.0.7/git.html[documentation for release 1.5.0.7]
66 link:RelNotes-1.5.0.7.txt[1.5.0.7],
67 link:RelNotes-1.5.0.6.txt[1.5.0.6],
68 link:RelNotes-1.5.0.5.txt[1.5.0.5],
69 link:RelNotes-1.5.0.3.txt[1.5.0.3],
70 link:RelNotes-1.5.0.2.txt[1.5.0.2],
71 link:RelNotes-1.5.0.1.txt[1.5.0.1],
72 link:RelNotes-1.5.0.txt[1.5.0].
74 * documentation for release link:v1.4.4.4/git.html[1.4.4.4],
75 link:v1.3.3/git.html[1.3.3],
76 link:v1.2.6/git.html[1.2.6],
77 link:v1.0.13/git.html[1.0.13].
86 Prints the git suite version that the 'git' program came from.
89 Prints the synopsis and a list of the most commonly used
90 commands. If a git command is named this option will bring up
91 the man-page for that command. If the option '--all' or '-a' is
92 given then all available commands are printed.
95 Path to wherever your core git programs are installed.
96 This can also be controlled by setting the GIT_EXEC_PATH
97 environment variable. If no path is given 'git' will print
98 the current setting and then exit.
101 Pipe all output into 'less' (or if set, $PAGER).
104 Set the path to the repository. This can also be controlled by
105 setting the GIT_DIR environment variable.
108 Set the path to the working tree. The value will not be
109 used in combination with repositories found automatically in
110 a .git directory (i.e. $GIT_DIR is not set).
111 This can also be controlled by setting the GIT_WORK_TREE
112 environment variable and the core.worktree configuration
116 Same as --git-dir=`pwd`.
118 FURTHER DOCUMENTATION
119 ---------------------
121 See the references above to get started using git. The following is
122 probably more detail than necessary for a first-time user.
124 The <<Discussion,Discussion>> section below and the
125 link:core-tutorial.html[Core tutorial] both provide introductions to the
126 underlying git architecture.
128 See also the link:howto-index.html[howto] documents for some useful
134 We divide git into high level ("porcelain") commands and low level
135 ("plumbing") commands.
137 High-level commands (porcelain)
138 -------------------------------
140 We separate the porcelain commands into the main commands and some
141 ancillary user utilities.
143 Main porcelain commands
144 ~~~~~~~~~~~~~~~~~~~~~~~
146 include::cmds-mainporcelain.txt[]
152 include::cmds-ancillarymanipulators.txt[]
156 include::cmds-ancillaryinterrogators.txt[]
159 Interacting with Others
160 ~~~~~~~~~~~~~~~~~~~~~~~
162 These commands are to interact with foreign SCM and with other
163 people via patch over e-mail.
165 include::cmds-foreignscminterface.txt[]
168 Low-level commands (plumbing)
169 -----------------------------
171 Although git includes its
172 own porcelain layer, its low-level commands are sufficient to support
173 development of alternative porcelains. Developers of such porcelains
174 might start by reading about gitlink:git-update-index[1] and
175 gitlink:git-read-tree[1].
177 The interface (input, output, set of options and the semantics)
178 to these low-level commands are meant to be a lot more stable
179 than Porcelain level commands, because these commands are
180 primarily for scripted use. The interface to Porcelain commands
181 on the other hand are subject to change in order to improve the
184 The following description divides
185 the low-level commands into commands that manipulate objects (in
186 the repository, index, and working tree), commands that interrogate and
187 compare objects, and commands that move objects and references between
191 Manipulation commands
192 ~~~~~~~~~~~~~~~~~~~~~
194 include::cmds-plumbingmanipulators.txt[]
197 Interrogation commands
198 ~~~~~~~~~~~~~~~~~~~~~~
200 include::cmds-plumbinginterrogators.txt[]
202 In general, the interrogate commands do not touch the files in
206 Synching repositories
207 ~~~~~~~~~~~~~~~~~~~~~
209 include::cmds-synchingrepositories.txt[]
211 The following are helper programs used by the above; end users
212 typically do not use them directly.
214 include::cmds-synchelpers.txt[]
217 Internal helper commands
218 ~~~~~~~~~~~~~~~~~~~~~~~~
220 These are internal helper commands used by other commands; end
221 users typically do not use them directly.
223 include::cmds-purehelpers.txt[]
226 Configuration Mechanism
227 -----------------------
229 Starting from 0.99.9 (actually mid 0.99.8.GIT), `.git/config` file
230 is used to hold per-repository configuration options. It is a
231 simple text file modeled after `.ini` format familiar to some
232 people. Here is an example:
236 # A '#' or ';' character indicates a comment.
241 ; Don't trust file modes
246 name = "Junio C Hamano"
247 email = "junkio@twinsun.com"
251 Various commands read from the configuration file and adjust
252 their operation accordingly.
255 Identifier Terminology
256 ----------------------
258 Indicates the object name for any type of object.
261 Indicates a blob object name.
264 Indicates a tree object name.
267 Indicates a commit object name.
270 Indicates a tree, commit or tag object name. A
271 command that takes a <tree-ish> argument ultimately wants to
272 operate on a <tree> object but automatically dereferences
273 <commit> and <tag> objects that point at a <tree>.
276 Indicates a commit or tag object name. A
277 command that takes a <commit-ish> argument ultimately wants to
278 operate on a <commit> object but automatically dereferences
279 <tag> objects that point at a <commit>.
282 Indicates that an object type is required.
283 Currently one of: `blob`, `tree`, `commit`, or `tag`.
286 Indicates a filename - almost always relative to the
287 root of the tree structure `GIT_INDEX_FILE` describes.
291 Any git command accepting any <object> can also use the following
295 indicates the head of the current branch (i.e. the
296 contents of `$GIT_DIR/HEAD`).
300 (i.e. the contents of `$GIT_DIR/refs/tags/<tag>`).
304 (i.e. the contents of `$GIT_DIR/refs/heads/<head>`).
306 For a more complete list of ways to spell object names, see
307 "SPECIFYING REVISIONS" section in gitlink:git-rev-parse[1].
310 File/Directory Structure
311 ------------------------
313 Please see link:repository-layout.html[repository layout] document.
315 Read link:hooks.html[hooks] for more details about each hook.
317 Higher level SCMs may provide and manage additional information in the
323 Please see link:glossary.html[glossary] document.
326 Environment Variables
327 ---------------------
328 Various git commands use the following environment variables:
332 These environment variables apply to 'all' core git commands. Nb: it
333 is worth noting that they may be used/overridden by SCMS sitting above
334 git so take care if using Cogito etc.
337 This environment allows the specification of an alternate
338 index file. If not specified, the default of `$GIT_DIR/index`
341 'GIT_OBJECT_DIRECTORY'::
342 If the object storage directory is specified via this
343 environment variable then the sha1 directories are created
344 underneath - otherwise the default `$GIT_DIR/objects`
347 'GIT_ALTERNATE_OBJECT_DIRECTORIES'::
348 Due to the immutable nature of git objects, old objects can be
349 archived into shared, read-only directories. This variable
350 specifies a ":" separated list of git object directories which
351 can be used to search for git objects. New objects will not be
352 written to these directories.
355 If the 'GIT_DIR' environment variable is set then it
356 specifies a path to use instead of the default `.git`
357 for the base of the repository.
360 Set the path to the working tree. The value will not be
361 used in combination with repositories found automatically in
362 a .git directory (i.e. $GIT_DIR is not set).
363 This can also be controlled by the '--work-tree' command line
364 option and the core.worktree configuration variable.
371 'GIT_COMMITTER_NAME'::
372 'GIT_COMMITTER_EMAIL'::
373 'GIT_COMMITTER_DATE'::
375 see gitlink:git-commit-tree[1]
380 Only valid setting is "--unified=??" or "-u??" to set the
381 number of context lines shown when a unified diff is created.
382 This takes precedence over any "-U" or "--unified" option
383 value passed on the git diff command line.
385 'GIT_EXTERNAL_DIFF'::
386 When the environment variable 'GIT_EXTERNAL_DIFF' is set, the
387 program named by it is called, instead of the diff invocation
388 described above. For a path that is added, removed, or modified,
389 'GIT_EXTERNAL_DIFF' is called with 7 parameters:
391 path old-file old-hex old-mode new-file new-hex new-mode
395 <old|new>-file:: are files GIT_EXTERNAL_DIFF can use to read the
396 contents of <old|new>,
397 <old|new>-hex:: are the 40-hexdigit SHA1 hashes,
398 <old|new>-mode:: are the octal representation of the file modes.
401 The file parameters can point at the user's working file
402 (e.g. `new-file` in "git-diff-files"), `/dev/null` (e.g. `old-file`
403 when a new file is added), or a temporary file (e.g. `old-file` in the
404 index). 'GIT_EXTERNAL_DIFF' should not worry about unlinking the
405 temporary file --- it is removed when 'GIT_EXTERNAL_DIFF' exits.
407 For a path that is unmerged, 'GIT_EXTERNAL_DIFF' is called with 1
413 This environment variable overrides `$PAGER`.
416 If this environment variable is set to "1", then commands such
417 as git-blame (in incremental mode), git-rev-list, git-log,
418 git-whatchanged, etc., will force a flush of the output stream
419 after each commit-oriented record have been flushed. If this
420 variable is set to "0", the output of these commands will be done
421 using completely buffered I/O. If this environment variable is
422 not set, git will choose buffered or record-oriented flushing
423 based on whether stdout appears to be redirected to a file or not.
426 If this variable is set to "1", "2" or "true" (comparison
427 is case insensitive), git will print `trace:` messages on
428 stderr telling about alias expansion, built-in command
429 execution and external command execution.
430 If this variable is set to an integer value greater than 1
431 and lower than 10 (strictly) then git will interpret this
432 value as an open file descriptor and will try to write the
433 trace messages into this file descriptor.
434 Alternatively, if this variable is set to an absolute path
435 (starting with a '/' character), git will interpret this
436 as a file path and will try to write the trace messages
439 Discussion[[Discussion]]
440 ------------------------
441 include::core-intro.txt[]
445 * git's founding father is Linus Torvalds <torvalds@osdl.org>.
446 * The current git nurse is Junio C Hamano <junkio@cox.net>.
447 * The git potty was written by Andres Ericsson <ae@op5.se>.
448 * General upbringing is handled by the git-list <git@vger.kernel.org>.
452 The documentation for git suite was started by David Greaves
453 <david@dgreaves.com>, and later enhanced greatly by the
454 contributors on the git-list <git@vger.kernel.org>.
458 Part of the gitlink:git[7] suite