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