Git 1.7.11
[git/gitweb.git] / Documentation / git.txt
blob59ce6ac241833efd09571ffe957e23a0e7784396
1 git(1)
2 ======
4 NAME
5 ----
6 git - the stupid content tracker
9 SYNOPSIS
10 --------
11 [verse]
12 'git' [--version] [--help] [-c <name>=<value>]
13     [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
14     [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
15     [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
16     <command> [<args>]
18 DESCRIPTION
19 -----------
20 Git is a fast, scalable, distributed revision control system with an
21 unusually rich command set that provides both high-level operations
22 and full access to internals.
24 See linkgit:gittutorial[7] to get started, then see
25 link:everyday.html[Everyday Git] for a useful minimum set of commands, and
26 "man git-commandname" for documentation of each command.  CVS users may
27 also want to read linkgit:gitcvs-migration[7].  See
28 the link:user-manual.html[Git User's Manual] for a more in-depth
29 introduction.
31 The '<command>' is either a name of a Git command (see below) or an alias
32 as defined in the configuration file (see linkgit:git-config[1]).
34 Formatted and hyperlinked version of the latest git
35 documentation can be viewed at
36 `http://www.kernel.org/pub/software/scm/git/docs/`.
38 ifdef::stalenotes[]
39 [NOTE]
40 ============
42 You are reading the documentation for the latest (possibly
43 unreleased) version of git, that is available from 'master'
44 branch of the `git.git` repository.
45 Documentation for older releases are available here:
47 * link:v1.7.11/git.html[documentation for release 1.7.11]
49 * release notes for
50   link:RelNotes/1.7.11.txt[1.7.11].
52 * link:v1.7.10.5/git.html[documentation for release 1.7.10.5]
54 * release notes for
55   link:RelNotes/1.7.10.5.txt[1.7.10.5],
56   link:RelNotes/1.7.10.4.txt[1.7.10.4],
57   link:RelNotes/1.7.10.3.txt[1.7.10.3],
58   link:RelNotes/1.7.10.2.txt[1.7.10.2],
59   link:RelNotes/1.7.10.1.txt[1.7.10.1],
60   link:RelNotes/1.7.10.txt[1.7.10].
62 * link:v1.7.9.7/git.html[documentation for release 1.7.9.7]
64 * release notes for
65   link:RelNotes/1.7.9.7.txt[1.7.9.7],
66   link:RelNotes/1.7.9.6.txt[1.7.9.6],
67   link:RelNotes/1.7.9.5.txt[1.7.9.5],
68   link:RelNotes/1.7.9.4.txt[1.7.9.4],
69   link:RelNotes/1.7.9.3.txt[1.7.9.3],
70   link:RelNotes/1.7.9.2.txt[1.7.9.2],
71   link:RelNotes/1.7.9.1.txt[1.7.9.1],
72   link:RelNotes/1.7.9.txt[1.7.9].
74 * link:v1.7.8.6/git.html[documentation for release 1.7.8.6]
76 * release notes for
77   link:RelNotes/1.7.8.6.txt[1.7.8.6],
78   link:RelNotes/1.7.8.5.txt[1.7.8.5],
79   link:RelNotes/1.7.8.4.txt[1.7.8.4],
80   link:RelNotes/1.7.8.3.txt[1.7.8.3],
81   link:RelNotes/1.7.8.2.txt[1.7.8.2],
82   link:RelNotes/1.7.8.1.txt[1.7.8.1],
83   link:RelNotes/1.7.8.txt[1.7.8].
85 * link:v1.7.7.7/git.html[documentation for release 1.7.7.7]
87 * release notes for
88   link:RelNotes/1.7.7.7.txt[1.7.7.7],
89   link:RelNotes/1.7.7.6.txt[1.7.7.6],
90   link:RelNotes/1.7.7.5.txt[1.7.7.5],
91   link:RelNotes/1.7.7.4.txt[1.7.7.4],
92   link:RelNotes/1.7.7.3.txt[1.7.7.3],
93   link:RelNotes/1.7.7.2.txt[1.7.7.2],
94   link:RelNotes/1.7.7.1.txt[1.7.7.1],
95   link:RelNotes/1.7.7.txt[1.7.7].
97 * link:v1.7.6.6/git.html[documentation for release 1.7.6.6]
99 * release notes for
100   link:RelNotes/1.7.6.6.txt[1.7.6.6],
101   link:RelNotes/1.7.6.5.txt[1.7.6.5],
102   link:RelNotes/1.7.6.4.txt[1.7.6.4],
103   link:RelNotes/1.7.6.3.txt[1.7.6.3],
104   link:RelNotes/1.7.6.2.txt[1.7.6.2],
105   link:RelNotes/1.7.6.1.txt[1.7.6.1],
106   link:RelNotes/1.7.6.txt[1.7.6].
108 * link:v1.7.5.4/git.html[documentation for release 1.7.5.4]
110 * release notes for
111   link:RelNotes/1.7.5.4.txt[1.7.5.4],
112   link:RelNotes/1.7.5.3.txt[1.7.5.3],
113   link:RelNotes/1.7.5.2.txt[1.7.5.2],
114   link:RelNotes/1.7.5.1.txt[1.7.5.1],
115   link:RelNotes/1.7.5.txt[1.7.5].
117 * link:v1.7.4.5/git.html[documentation for release 1.7.4.5]
119 * release notes for
120   link:RelNotes/1.7.4.5.txt[1.7.4.5],
121   link:RelNotes/1.7.4.4.txt[1.7.4.4],
122   link:RelNotes/1.7.4.3.txt[1.7.4.3],
123   link:RelNotes/1.7.4.2.txt[1.7.4.2],
124   link:RelNotes/1.7.4.1.txt[1.7.4.1],
125   link:RelNotes/1.7.4.txt[1.7.4].
127 * link:v1.7.3.5/git.html[documentation for release 1.7.3.5]
129 * release notes for
130   link:RelNotes/1.7.3.5.txt[1.7.3.5],
131   link:RelNotes/1.7.3.4.txt[1.7.3.4],
132   link:RelNotes/1.7.3.3.txt[1.7.3.3],
133   link:RelNotes/1.7.3.2.txt[1.7.3.2],
134   link:RelNotes/1.7.3.1.txt[1.7.3.1],
135   link:RelNotes/1.7.3.txt[1.7.3].
137 * link:v1.7.2.5/git.html[documentation for release 1.7.2.5]
139 * release notes for
140   link:RelNotes/1.7.2.5.txt[1.7.2.5],
141   link:RelNotes/1.7.2.4.txt[1.7.2.4],
142   link:RelNotes/1.7.2.3.txt[1.7.2.3],
143   link:RelNotes/1.7.2.2.txt[1.7.2.2],
144   link:RelNotes/1.7.2.1.txt[1.7.2.1],
145   link:RelNotes/1.7.2.txt[1.7.2].
147 * link:v1.7.1.4/git.html[documentation for release 1.7.1.4]
149 * release notes for
150   link:RelNotes/1.7.1.4.txt[1.7.1.4],
151   link:RelNotes/1.7.1.3.txt[1.7.1.3],
152   link:RelNotes/1.7.1.2.txt[1.7.1.2],
153   link:RelNotes/1.7.1.1.txt[1.7.1.1],
154   link:RelNotes/1.7.1.txt[1.7.1].
156 * link:v1.7.0.9/git.html[documentation for release 1.7.0.9]
158 * release notes for
159   link:RelNotes/1.7.0.9.txt[1.7.0.9],
160   link:RelNotes/1.7.0.8.txt[1.7.0.8],
161   link:RelNotes/1.7.0.7.txt[1.7.0.7],
162   link:RelNotes/1.7.0.6.txt[1.7.0.6],
163   link:RelNotes/1.7.0.5.txt[1.7.0.5],
164   link:RelNotes/1.7.0.4.txt[1.7.0.4],
165   link:RelNotes/1.7.0.3.txt[1.7.0.3],
166   link:RelNotes/1.7.0.2.txt[1.7.0.2],
167   link:RelNotes/1.7.0.1.txt[1.7.0.1],
168   link:RelNotes/1.7.0.txt[1.7.0].
170 * link:v1.6.6.3/git.html[documentation for release 1.6.6.3]
172 * release notes for
173   link:RelNotes/1.6.6.3.txt[1.6.6.3],
174   link:RelNotes/1.6.6.2.txt[1.6.6.2],
175   link:RelNotes/1.6.6.1.txt[1.6.6.1],
176   link:RelNotes/1.6.6.txt[1.6.6].
178 * link:v1.6.5.9/git.html[documentation for release 1.6.5.9]
180 * release notes for
181   link:RelNotes/1.6.5.9.txt[1.6.5.9],
182   link:RelNotes/1.6.5.8.txt[1.6.5.8],
183   link:RelNotes/1.6.5.7.txt[1.6.5.7],
184   link:RelNotes/1.6.5.6.txt[1.6.5.6],
185   link:RelNotes/1.6.5.5.txt[1.6.5.5],
186   link:RelNotes/1.6.5.4.txt[1.6.5.4],
187   link:RelNotes/1.6.5.3.txt[1.6.5.3],
188   link:RelNotes/1.6.5.2.txt[1.6.5.2],
189   link:RelNotes/1.6.5.1.txt[1.6.5.1],
190   link:RelNotes/1.6.5.txt[1.6.5].
192 * link:v1.6.4.5/git.html[documentation for release 1.6.4.5]
194 * release notes for
195   link:RelNotes/1.6.4.5.txt[1.6.4.5],
196   link:RelNotes/1.6.4.4.txt[1.6.4.4],
197   link:RelNotes/1.6.4.3.txt[1.6.4.3],
198   link:RelNotes/1.6.4.2.txt[1.6.4.2],
199   link:RelNotes/1.6.4.1.txt[1.6.4.1],
200   link:RelNotes/1.6.4.txt[1.6.4].
202 * link:v1.6.3.4/git.html[documentation for release 1.6.3.4]
204 * release notes for
205   link:RelNotes/1.6.3.4.txt[1.6.3.4],
206   link:RelNotes/1.6.3.3.txt[1.6.3.3],
207   link:RelNotes/1.6.3.2.txt[1.6.3.2],
208   link:RelNotes/1.6.3.1.txt[1.6.3.1],
209   link:RelNotes/1.6.3.txt[1.6.3].
211 * release notes for
212   link:RelNotes/1.6.2.5.txt[1.6.2.5],
213   link:RelNotes/1.6.2.4.txt[1.6.2.4],
214   link:RelNotes/1.6.2.3.txt[1.6.2.3],
215   link:RelNotes/1.6.2.2.txt[1.6.2.2],
216   link:RelNotes/1.6.2.1.txt[1.6.2.1],
217   link:RelNotes/1.6.2.txt[1.6.2].
219 * link:v1.6.1.3/git.html[documentation for release 1.6.1.3]
221 * release notes for
222   link:RelNotes/1.6.1.3.txt[1.6.1.3],
223   link:RelNotes/1.6.1.2.txt[1.6.1.2],
224   link:RelNotes/1.6.1.1.txt[1.6.1.1],
225   link:RelNotes/1.6.1.txt[1.6.1].
227 * link:v1.6.0.6/git.html[documentation for release 1.6.0.6]
229 * release notes for
230   link:RelNotes/1.6.0.6.txt[1.6.0.6],
231   link:RelNotes/1.6.0.5.txt[1.6.0.5],
232   link:RelNotes/1.6.0.4.txt[1.6.0.4],
233   link:RelNotes/1.6.0.3.txt[1.6.0.3],
234   link:RelNotes/1.6.0.2.txt[1.6.0.2],
235   link:RelNotes/1.6.0.1.txt[1.6.0.1],
236   link:RelNotes/1.6.0.txt[1.6.0].
238 * link:v1.5.6.6/git.html[documentation for release 1.5.6.6]
240 * release notes for
241   link:RelNotes/1.5.6.6.txt[1.5.6.6],
242   link:RelNotes/1.5.6.5.txt[1.5.6.5],
243   link:RelNotes/1.5.6.4.txt[1.5.6.4],
244   link:RelNotes/1.5.6.3.txt[1.5.6.3],
245   link:RelNotes/1.5.6.2.txt[1.5.6.2],
246   link:RelNotes/1.5.6.1.txt[1.5.6.1],
247   link:RelNotes/1.5.6.txt[1.5.6].
249 * link:v1.5.5.6/git.html[documentation for release 1.5.5.6]
251 * release notes for
252   link:RelNotes/1.5.5.6.txt[1.5.5.6],
253   link:RelNotes/1.5.5.5.txt[1.5.5.5],
254   link:RelNotes/1.5.5.4.txt[1.5.5.4],
255   link:RelNotes/1.5.5.3.txt[1.5.5.3],
256   link:RelNotes/1.5.5.2.txt[1.5.5.2],
257   link:RelNotes/1.5.5.1.txt[1.5.5.1],
258   link:RelNotes/1.5.5.txt[1.5.5].
260 * link:v1.5.4.7/git.html[documentation for release 1.5.4.7]
262 * release notes for
263   link:RelNotes/1.5.4.7.txt[1.5.4.7],
264   link:RelNotes/1.5.4.6.txt[1.5.4.6],
265   link:RelNotes/1.5.4.5.txt[1.5.4.5],
266   link:RelNotes/1.5.4.4.txt[1.5.4.4],
267   link:RelNotes/1.5.4.3.txt[1.5.4.3],
268   link:RelNotes/1.5.4.2.txt[1.5.4.2],
269   link:RelNotes/1.5.4.1.txt[1.5.4.1],
270   link:RelNotes/1.5.4.txt[1.5.4].
272 * link:v1.5.3.8/git.html[documentation for release 1.5.3.8]
274 * release notes for
275   link:RelNotes/1.5.3.8.txt[1.5.3.8],
276   link:RelNotes/1.5.3.7.txt[1.5.3.7],
277   link:RelNotes/1.5.3.6.txt[1.5.3.6],
278   link:RelNotes/1.5.3.5.txt[1.5.3.5],
279   link:RelNotes/1.5.3.4.txt[1.5.3.4],
280   link:RelNotes/1.5.3.3.txt[1.5.3.3],
281   link:RelNotes/1.5.3.2.txt[1.5.3.2],
282   link:RelNotes/1.5.3.1.txt[1.5.3.1],
283   link:RelNotes/1.5.3.txt[1.5.3].
285 * link:v1.5.2.5/git.html[documentation for release 1.5.2.5]
287 * release notes for
288   link:RelNotes/1.5.2.5.txt[1.5.2.5],
289   link:RelNotes/1.5.2.4.txt[1.5.2.4],
290   link:RelNotes/1.5.2.3.txt[1.5.2.3],
291   link:RelNotes/1.5.2.2.txt[1.5.2.2],
292   link:RelNotes/1.5.2.1.txt[1.5.2.1],
293   link:RelNotes/1.5.2.txt[1.5.2].
295 * link:v1.5.1.6/git.html[documentation for release 1.5.1.6]
297 * release notes for
298   link:RelNotes/1.5.1.6.txt[1.5.1.6],
299   link:RelNotes/1.5.1.5.txt[1.5.1.5],
300   link:RelNotes/1.5.1.4.txt[1.5.1.4],
301   link:RelNotes/1.5.1.3.txt[1.5.1.3],
302   link:RelNotes/1.5.1.2.txt[1.5.1.2],
303   link:RelNotes/1.5.1.1.txt[1.5.1.1],
304   link:RelNotes/1.5.1.txt[1.5.1].
306 * link:v1.5.0.7/git.html[documentation for release 1.5.0.7]
308 * release notes for
309   link:RelNotes/1.5.0.7.txt[1.5.0.7],
310   link:RelNotes/1.5.0.6.txt[1.5.0.6],
311   link:RelNotes/1.5.0.5.txt[1.5.0.5],
312   link:RelNotes/1.5.0.3.txt[1.5.0.3],
313   link:RelNotes/1.5.0.2.txt[1.5.0.2],
314   link:RelNotes/1.5.0.1.txt[1.5.0.1],
315   link:RelNotes/1.5.0.txt[1.5.0].
317 * documentation for release link:v1.4.4.4/git.html[1.4.4.4],
318   link:v1.3.3/git.html[1.3.3],
319   link:v1.2.6/git.html[1.2.6],
320   link:v1.0.13/git.html[1.0.13].
322 ============
324 endif::stalenotes[]
326 OPTIONS
327 -------
328 --version::
329         Prints the git suite version that the 'git' program came from.
331 --help::
332         Prints the synopsis and a list of the most commonly used
333         commands. If the option '--all' or '-a' is given then all
334         available commands are printed. If a git command is named this
335         option will bring up the manual page for that command.
337 Other options are available to control how the manual page is
338 displayed. See linkgit:git-help[1] for more information,
339 because `git --help ...` is converted internally into `git
340 help ...`.
342 -c <name>=<value>::
343         Pass a configuration parameter to the command. The value
344         given will override values from configuration files.
345         The <name> is expected in the same format as listed by
346         'git config' (subkeys separated by dots).
348 --exec-path[=<path>]::
349         Path to wherever your core git programs are installed.
350         This can also be controlled by setting the GIT_EXEC_PATH
351         environment variable. If no path is given, 'git' will print
352         the current setting and then exit.
354 --html-path::
355         Print the path, without trailing slash, where git's HTML
356         documentation is installed and exit.
358 --man-path::
359         Print the manpath (see `man(1)`) for the man pages for
360         this version of git and exit.
362 --info-path::
363         Print the path where the Info files documenting this
364         version of git are installed and exit.
366 -p::
367 --paginate::
368         Pipe all output into 'less' (or if set, $PAGER) if standard
369         output is a terminal.  This overrides the `pager.<cmd>`
370         configuration options (see the "Configuration Mechanism" section
371         below).
373 --no-pager::
374         Do not pipe git output into a pager.
376 --git-dir=<path>::
377         Set the path to the repository. This can also be controlled by
378         setting the GIT_DIR environment variable. It can be an absolute
379         path or relative path to current working directory.
381 --work-tree=<path>::
382         Set the path to the working tree. It can be an absolute path
383         or a path relative to the current working directory.
384         This can also be controlled by setting the GIT_WORK_TREE
385         environment variable and the core.worktree configuration
386         variable (see core.worktree in linkgit:git-config[1] for a
387         more detailed discussion).
389 --namespace=<path>::
390         Set the git namespace.  See linkgit:gitnamespaces[7] for more
391         details.  Equivalent to setting the `GIT_NAMESPACE` environment
392         variable.
394 --bare::
395         Treat the repository as a bare repository.  If GIT_DIR
396         environment is not set, it is set to the current working
397         directory.
399 --no-replace-objects::
400         Do not use replacement refs to replace git objects. See
401         linkgit:git-replace[1] for more information.
404 FURTHER DOCUMENTATION
405 ---------------------
407 See the references above to get started using git.  The following is
408 probably more detail than necessary for a first-time user.
410 The link:user-manual.html#git-concepts[git concepts chapter of the
411 user-manual] and linkgit:gitcore-tutorial[7] both provide
412 introductions to the underlying git architecture.
414 See linkgit:gitworkflows[7] for an overview of recommended workflows.
416 See also the link:howto-index.html[howto] documents for some useful
417 examples.
419 The internals are documented in the
420 link:technical/api-index.html[GIT API documentation].
422 GIT COMMANDS
423 ------------
425 We divide git into high level ("porcelain") commands and low level
426 ("plumbing") commands.
428 High-level commands (porcelain)
429 -------------------------------
431 We separate the porcelain commands into the main commands and some
432 ancillary user utilities.
434 Main porcelain commands
435 ~~~~~~~~~~~~~~~~~~~~~~~
437 include::cmds-mainporcelain.txt[]
439 Ancillary Commands
440 ~~~~~~~~~~~~~~~~~~
441 Manipulators:
443 include::cmds-ancillarymanipulators.txt[]
445 Interrogators:
447 include::cmds-ancillaryinterrogators.txt[]
450 Interacting with Others
451 ~~~~~~~~~~~~~~~~~~~~~~~
453 These commands are to interact with foreign SCM and with other
454 people via patch over e-mail.
456 include::cmds-foreignscminterface.txt[]
459 Low-level commands (plumbing)
460 -----------------------------
462 Although git includes its
463 own porcelain layer, its low-level commands are sufficient to support
464 development of alternative porcelains.  Developers of such porcelains
465 might start by reading about linkgit:git-update-index[1] and
466 linkgit:git-read-tree[1].
468 The interface (input, output, set of options and the semantics)
469 to these low-level commands are meant to be a lot more stable
470 than Porcelain level commands, because these commands are
471 primarily for scripted use.  The interface to Porcelain commands
472 on the other hand are subject to change in order to improve the
473 end user experience.
475 The following description divides
476 the low-level commands into commands that manipulate objects (in
477 the repository, index, and working tree), commands that interrogate and
478 compare objects, and commands that move objects and references between
479 repositories.
482 Manipulation commands
483 ~~~~~~~~~~~~~~~~~~~~~
485 include::cmds-plumbingmanipulators.txt[]
488 Interrogation commands
489 ~~~~~~~~~~~~~~~~~~~~~~
491 include::cmds-plumbinginterrogators.txt[]
493 In general, the interrogate commands do not touch the files in
494 the working tree.
497 Synching repositories
498 ~~~~~~~~~~~~~~~~~~~~~
500 include::cmds-synchingrepositories.txt[]
502 The following are helper commands used by the above; end users
503 typically do not use them directly.
505 include::cmds-synchelpers.txt[]
508 Internal helper commands
509 ~~~~~~~~~~~~~~~~~~~~~~~~
511 These are internal helper commands used by other commands; end
512 users typically do not use them directly.
514 include::cmds-purehelpers.txt[]
517 Configuration Mechanism
518 -----------------------
520 Starting from 0.99.9 (actually mid 0.99.8.GIT), `.git/config` file
521 is used to hold per-repository configuration options.  It is a
522 simple text file modeled after `.ini` format familiar to some
523 people.  Here is an example:
525 ------------
527 # A '#' or ';' character indicates a comment.
530 ; core variables
531 [core]
532         ; Don't trust file modes
533         filemode = false
535 ; user identity
536 [user]
537         name = "Junio C Hamano"
538         email = "junkio@twinsun.com"
540 ------------
542 Various commands read from the configuration file and adjust
543 their operation accordingly.  See linkgit:git-config[1] for a
544 list.
547 Identifier Terminology
548 ----------------------
549 <object>::
550         Indicates the object name for any type of object.
552 <blob>::
553         Indicates a blob object name.
555 <tree>::
556         Indicates a tree object name.
558 <commit>::
559         Indicates a commit object name.
561 <tree-ish>::
562         Indicates a tree, commit or tag object name.  A
563         command that takes a <tree-ish> argument ultimately wants to
564         operate on a <tree> object but automatically dereferences
565         <commit> and <tag> objects that point at a <tree>.
567 <commit-ish>::
568         Indicates a commit or tag object name.  A
569         command that takes a <commit-ish> argument ultimately wants to
570         operate on a <commit> object but automatically dereferences
571         <tag> objects that point at a <commit>.
573 <type>::
574         Indicates that an object type is required.
575         Currently one of: `blob`, `tree`, `commit`, or `tag`.
577 <file>::
578         Indicates a filename - almost always relative to the
579         root of the tree structure `GIT_INDEX_FILE` describes.
581 Symbolic Identifiers
582 --------------------
583 Any git command accepting any <object> can also use the following
584 symbolic notation:
586 HEAD::
587         indicates the head of the current branch.
589 <tag>::
590         a valid tag 'name'
591         (i.e. a `refs/tags/<tag>` reference).
593 <head>::
594         a valid head 'name'
595         (i.e. a `refs/heads/<head>` reference).
597 For a more complete list of ways to spell object names, see
598 "SPECIFYING REVISIONS" section in linkgit:gitrevisions[7].
601 File/Directory Structure
602 ------------------------
604 Please see the linkgit:gitrepository-layout[5] document.
606 Read linkgit:githooks[5] for more details about each hook.
608 Higher level SCMs may provide and manage additional information in the
609 `$GIT_DIR`.
612 Terminology
613 -----------
614 Please see linkgit:gitglossary[7].
617 Environment Variables
618 ---------------------
619 Various git commands use the following environment variables:
621 The git Repository
622 ~~~~~~~~~~~~~~~~~~
623 These environment variables apply to 'all' core git commands. Nb: it
624 is worth noting that they may be used/overridden by SCMS sitting above
625 git so take care if using Cogito etc.
627 'GIT_INDEX_FILE'::
628         This environment allows the specification of an alternate
629         index file. If not specified, the default of `$GIT_DIR/index`
630         is used.
632 'GIT_OBJECT_DIRECTORY'::
633         If the object storage directory is specified via this
634         environment variable then the sha1 directories are created
635         underneath - otherwise the default `$GIT_DIR/objects`
636         directory is used.
638 'GIT_ALTERNATE_OBJECT_DIRECTORIES'::
639         Due to the immutable nature of git objects, old objects can be
640         archived into shared, read-only directories. This variable
641         specifies a ":" separated (on Windows ";" separated) list
642         of git object directories which can be used to search for git
643         objects. New objects will not be written to these directories.
645 'GIT_DIR'::
646         If the 'GIT_DIR' environment variable is set then it
647         specifies a path to use instead of the default `.git`
648         for the base of the repository.
650 'GIT_WORK_TREE'::
651         Set the path to the working tree.  The value will not be
652         used in combination with repositories found automatically in
653         a .git directory (i.e. $GIT_DIR is not set).
654         This can also be controlled by the '--work-tree' command line
655         option and the core.worktree configuration variable.
657 'GIT_NAMESPACE'::
658         Set the git namespace; see linkgit:gitnamespaces[7] for details.
659         The '--namespace' command-line option also sets this value.
661 'GIT_CEILING_DIRECTORIES'::
662         This should be a colon-separated list of absolute paths.
663         If set, it is a list of directories that git should not chdir
664         up into while looking for a repository directory.
665         It will not exclude the current working directory or
666         a GIT_DIR set on the command line or in the environment.
667         (Useful for excluding slow-loading network directories.)
669 'GIT_DISCOVERY_ACROSS_FILESYSTEM'::
670         When run in a directory that does not have ".git" repository
671         directory, git tries to find such a directory in the parent
672         directories to find the top of the working tree, but by default it
673         does not cross filesystem boundaries.  This environment variable
674         can be set to true to tell git not to stop at filesystem
675         boundaries.  Like 'GIT_CEILING_DIRECTORIES', this will not affect
676         an explicit repository directory set via 'GIT_DIR' or on the
677         command line.
679 git Commits
680 ~~~~~~~~~~~
681 'GIT_AUTHOR_NAME'::
682 'GIT_AUTHOR_EMAIL'::
683 'GIT_AUTHOR_DATE'::
684 'GIT_COMMITTER_NAME'::
685 'GIT_COMMITTER_EMAIL'::
686 'GIT_COMMITTER_DATE'::
687 'EMAIL'::
688         see linkgit:git-commit-tree[1]
690 git Diffs
691 ~~~~~~~~~
692 'GIT_DIFF_OPTS'::
693         Only valid setting is "--unified=??" or "-u??" to set the
694         number of context lines shown when a unified diff is created.
695         This takes precedence over any "-U" or "--unified" option
696         value passed on the git diff command line.
698 'GIT_EXTERNAL_DIFF'::
699         When the environment variable 'GIT_EXTERNAL_DIFF' is set, the
700         program named by it is called, instead of the diff invocation
701         described above.  For a path that is added, removed, or modified,
702         'GIT_EXTERNAL_DIFF' is called with 7 parameters:
704         path old-file old-hex old-mode new-file new-hex new-mode
706 where:
708         <old|new>-file:: are files GIT_EXTERNAL_DIFF can use to read the
709                          contents of <old|new>,
710         <old|new>-hex:: are the 40-hexdigit SHA1 hashes,
711         <old|new>-mode:: are the octal representation of the file modes.
713 The file parameters can point at the user's working file
714 (e.g. `new-file` in "git-diff-files"), `/dev/null` (e.g. `old-file`
715 when a new file is added), or a temporary file (e.g. `old-file` in the
716 index).  'GIT_EXTERNAL_DIFF' should not worry about unlinking the
717 temporary file --- it is removed when 'GIT_EXTERNAL_DIFF' exits.
719 For a path that is unmerged, 'GIT_EXTERNAL_DIFF' is called with 1
720 parameter, <path>.
722 other
723 ~~~~~
724 'GIT_MERGE_VERBOSITY'::
725         A number controlling the amount of output shown by
726         the recursive merge strategy.  Overrides merge.verbosity.
727         See linkgit:git-merge[1]
729 'GIT_PAGER'::
730         This environment variable overrides `$PAGER`. If it is set
731         to an empty string or to the value "cat", git will not launch
732         a pager.  See also the `core.pager` option in
733         linkgit:git-config[1].
735 'GIT_EDITOR'::
736         This environment variable overrides `$EDITOR` and `$VISUAL`.
737         It is used by several git comands when, on interactive mode,
738         an editor is to be launched. See also linkgit:git-var[1]
739         and the `core.editor` option in linkgit:git-config[1].
741 'GIT_SSH'::
742         If this environment variable is set then 'git fetch'
743         and 'git push' will use this command instead
744         of 'ssh' when they need to connect to a remote system.
745         The '$GIT_SSH' command will be given exactly two arguments:
746         the 'username@host' (or just 'host') from the URL and the
747         shell command to execute on that remote system.
749 To pass options to the program that you want to list in GIT_SSH
750 you will need to wrap the program and options into a shell script,
751 then set GIT_SSH to refer to the shell script.
753 Usually it is easier to configure any desired options through your
754 personal `.ssh/config` file.  Please consult your ssh documentation
755 for further details.
757 'GIT_ASKPASS'::
758         If this environment variable is set, then git commands which need to
759         acquire passwords or passphrases (e.g. for HTTP or IMAP authentication)
760         will call this program with a suitable prompt as command line argument
761         and read the password from its STDOUT. See also the 'core.askpass'
762         option in linkgit:git-config[1].
764 'GIT_FLUSH'::
765         If this environment variable is set to "1", then commands such
766         as 'git blame' (in incremental mode), 'git rev-list', 'git log',
767         and 'git whatchanged' will force a flush of the output stream
768         after each commit-oriented record have been flushed.   If this
769         variable is set to "0", the output of these commands will be done
770         using completely buffered I/O.   If this environment variable is
771         not set, git will choose buffered or record-oriented flushing
772         based on whether stdout appears to be redirected to a file or not.
774 'GIT_TRACE'::
775         If this variable is set to "1", "2" or "true" (comparison
776         is case insensitive), git will print `trace:` messages on
777         stderr telling about alias expansion, built-in command
778         execution and external command execution.
779         If this variable is set to an integer value greater than 1
780         and lower than 10 (strictly) then git will interpret this
781         value as an open file descriptor and will try to write the
782         trace messages into this file descriptor.
783         Alternatively, if this variable is set to an absolute path
784         (starting with a '/' character), git will interpret this
785         as a file path and will try to write the trace messages
786         into it.
788 Discussion[[Discussion]]
789 ------------------------
791 More detail on the following is available from the
792 link:user-manual.html#git-concepts[git concepts chapter of the
793 user-manual] and linkgit:gitcore-tutorial[7].
795 A git project normally consists of a working directory with a ".git"
796 subdirectory at the top level.  The .git directory contains, among other
797 things, a compressed object database representing the complete history
798 of the project, an "index" file which links that history to the current
799 contents of the working tree, and named pointers into that history such
800 as tags and branch heads.
802 The object database contains objects of three main types: blobs, which
803 hold file data; trees, which point to blobs and other trees to build up
804 directory hierarchies; and commits, which each reference a single tree
805 and some number of parent commits.
807 The commit, equivalent to what other systems call a "changeset" or
808 "version", represents a step in the project's history, and each parent
809 represents an immediately preceding step.  Commits with more than one
810 parent represent merges of independent lines of development.
812 All objects are named by the SHA1 hash of their contents, normally
813 written as a string of 40 hex digits.  Such names are globally unique.
814 The entire history leading up to a commit can be vouched for by signing
815 just that commit.  A fourth object type, the tag, is provided for this
816 purpose.
818 When first created, objects are stored in individual files, but for
819 efficiency may later be compressed together into "pack files".
821 Named pointers called refs mark interesting points in history.  A ref
822 may contain the SHA1 name of an object or the name of another ref.  Refs
823 with names beginning `ref/head/` contain the SHA1 name of the most
824 recent commit (or "head") of a branch under development.  SHA1 names of
825 tags of interest are stored under `ref/tags/`.  A special ref named
826 `HEAD` contains the name of the currently checked-out branch.
828 The index file is initialized with a list of all paths and, for each
829 path, a blob object and a set of attributes.  The blob object represents
830 the contents of the file as of the head of the current branch.  The
831 attributes (last modified time, size, etc.) are taken from the
832 corresponding file in the working tree.  Subsequent changes to the
833 working tree can be found by comparing these attributes.  The index may
834 be updated with new content, and new commits may be created from the
835 content stored in the index.
837 The index is also capable of storing multiple entries (called "stages")
838 for a given pathname.  These stages are used to hold the various
839 unmerged version of a file when a merge is in progress.
841 Authors
842 -------
843 Git was started by Linus Torvalds, and is currently maintained by Junio
844 C Hamano. Numerous contributions have come from the git mailing list
845 <git@vger.kernel.org>. For a more complete list of contributors, see
846 http://git-scm.com/about. If you have a clone of git.git itself, the
847 output of linkgit:git-shortlog[1] and linkgit:git-blame[1] can show you
848 the authors for specific parts of the project.
850 Reporting Bugs
851 --------------
853 Report bugs to the Git mailing list <git@vger.kernel.org> where the
854 development and maintenance is primarily done.  You do not have to be
855 subscribed to the list to send a message there.
857 SEE ALSO
858 --------
859 linkgit:gittutorial[7], linkgit:gittutorial-2[7],
860 link:everyday.html[Everyday Git], linkgit:gitcvs-migration[7],
861 linkgit:gitglossary[7], linkgit:gitcore-tutorial[7],
862 linkgit:gitcli[7], link:user-manual.html[The Git User's Manual],
863 linkgit:gitworkflows[7]
867 Part of the linkgit:git[1] suite