blob: b1cb97236982dd5fe718765136aa4f1a4fdb994f [file] [log] [blame]
Junio C Hamanof7c042d2008-06-06 22:50:531git(1)
Junio C Hamano1a4e8412005-12-27 08:17:232======
3
4NAME
5----
6git - the stupid content tracker
7
8
9SYNOPSIS
10--------
Junio C Hamano6b2cee12006-08-26 08:43:3111[verse]
Junio C Hamanocae86272007-08-21 02:20:4912'git' [--version] [--exec-path[=GIT_EXEC_PATH]]
13 [-p|--paginate|--no-pager]
Junio C Hamanod526ba92007-07-02 00:17:4214 [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]
15 [--help] COMMAND [ARGS]
Junio C Hamano1a4e8412005-12-27 08:17:2316
17DESCRIPTION
18-----------
Junio C Hamanoe27fb932006-04-03 05:34:1019Git is a fast, scalable, distributed revision control system with an
20unusually rich command set that provides both high-level operations
21and full access to internals.
22
Junio C Hamanofce7c7e2008-07-02 03:06:3823See linkgit:gittutorial[7] to get started, then see
Junio C Hamanoe27fb932006-04-03 05:34:1024link:everyday.html[Everyday Git] for a useful minimum set of commands, and
25"man git-commandname" for documentation of each command. CVS users may
Junio C Hamanofce7c7e2008-07-02 03:06:3826also want to read linkgit:gitcvs-migration[7]. See
27the link:user-manual.html[Git User's Manual] for a more in-depth
Junio C Hamano3d30fd52007-05-08 00:32:5328introduction.
Junio C Hamano1a4e8412005-12-27 08:17:2329
Junio C Hamano33db4372006-06-07 19:51:4530The COMMAND is either a name of a Git command (see below) or an alias
Junio C Hamano35738e82008-01-07 07:55:4631as defined in the configuration file (see linkgit:git-config[1]).
Junio C Hamano33db4372006-06-07 19:51:4532
Junio C Hamanob63afff2007-05-01 03:05:5533Formatted and hyperlinked version of the latest git
34documentation can be viewed at
35`http://www.kernel.org/pub/software/scm/git/docs/`.
36
Junio C Hamano9d52e572007-02-13 23:48:2037ifdef::stalenotes[]
38[NOTE]
39============
Junio C Hamano9d52e572007-02-13 23:48:2040
Junio C Hamanoa9b8d242007-05-19 04:51:5541You are reading the documentation for the latest (possibly
42unreleased) version of git, that is available from 'master'
43branch of the `git.git` repository.
44Documentation for older releases are available here:
Junio C Hamano2fc92602007-03-29 01:09:4645
Junio C Hamanob53db3c2008-08-07 00:17:5246* link:v1.5.6.5/git.html[documentation for release 1.5.6.5]
Junio C Hamano11fe55c2008-06-18 23:14:5647
48* release notes for
Junio C Hamanob53db3c2008-08-07 00:17:5249 link:RelNotes-1.5.6.5.txt[1.5.6.5],
Junio C Hamano915cd9b2008-07-20 01:24:1750 link:RelNotes-1.5.6.4.txt[1.5.6.4],
51 link:RelNotes-1.5.6.3.txt[1.5.6.3],
52 link:RelNotes-1.5.6.2.txt[1.5.6.2],
53 link:RelNotes-1.5.6.1.txt[1.5.6.1],
Junio C Hamano9eb57532008-06-26 06:33:4654 link:RelNotes-1.5.6.txt[1.5.6].
Junio C Hamano11fe55c2008-06-18 23:14:5655
Junio C Hamano9eb57532008-06-26 06:33:4656* link:v1.5.5.4/git.html[documentation for release 1.5.5.4]
Junio C Hamano0d0679d2008-04-08 06:15:4657
58* release notes for
Junio C Hamanoe2b205c2008-06-08 01:43:4459 link:RelNotes-1.5.5.4.txt[1.5.5.4],
Junio C Hamano99b28f22008-05-28 08:07:2660 link:RelNotes-1.5.5.3.txt[1.5.5.3],
Junio C Hamanob7a77fa2008-05-26 07:20:0161 link:RelNotes-1.5.5.2.txt[1.5.5.2],
Junio C Hamanoe3ddb5b2008-04-21 00:48:0762 link:RelNotes-1.5.5.1.txt[1.5.5.1],
Junio C Hamano0d0679d2008-04-08 06:15:4663 link:RelNotes-1.5.5.txt[1.5.5].
64
Junio C Hamano56033be2008-03-28 06:12:5365* link:v1.5.4.5/git.html[documentation for release 1.5.4.5]
Junio C Hamano7b9b4262008-02-02 06:48:3966
67* release notes for
Junio C Hamano56033be2008-03-28 06:12:5368 link:RelNotes-1.5.4.5.txt[1.5.4.5],
Junio C Hamanobb343172008-03-09 10:39:0969 link:RelNotes-1.5.4.4.txt[1.5.4.4],
Junio C Hamanocb174dd2008-02-23 21:03:5470 link:RelNotes-1.5.4.3.txt[1.5.4.3],
Junio C Hamanoe670d0d2008-02-17 20:14:5971 link:RelNotes-1.5.4.2.txt[1.5.4.2],
Junio C Hamanoefe3c632008-02-14 00:51:3172 link:RelNotes-1.5.4.1.txt[1.5.4.1],
Junio C Hamano7b9b4262008-02-02 06:48:3973 link:RelNotes-1.5.4.txt[1.5.4].
74
Junio C Hamano4e272312008-01-08 09:13:2175* link:v1.5.3.8/git.html[documentation for release 1.5.3.8]
Junio C Hamanoa75069c2007-09-04 01:19:2476
77* release notes for
Junio C Hamano4e272312008-01-08 09:13:2178 link:RelNotes-1.5.3.8.txt[1.5.3.8],
Junio C Hamano976c0c42007-12-01 21:57:1479 link:RelNotes-1.5.3.7.txt[1.5.3.7],
Junio C Hamanoe1258662007-11-19 05:03:1980 link:RelNotes-1.5.3.6.txt[1.5.3.6],
Junio C Hamano1c708832007-11-02 02:47:5081 link:RelNotes-1.5.3.5.txt[1.5.3.5],
Junio C Hamanoea719cf2007-10-04 13:06:3582 link:RelNotes-1.5.3.4.txt[1.5.3.4],
Junio C Hamano58992c92007-10-01 16:23:1883 link:RelNotes-1.5.3.3.txt[1.5.3.3],
Junio C Hamano199cdf12007-09-19 18:30:4784 link:RelNotes-1.5.3.2.txt[1.5.3.2],
Junio C Hamano61210dd2007-10-24 11:52:1385 link:RelNotes-1.5.3.1.txt[1.5.3.1],
86 link:RelNotes-1.5.3.txt[1.5.3].
Junio C Hamano75485c82007-05-19 04:20:3387
Junio C Hamano9eb57532008-06-26 06:33:4688* link:v1.5.2.5/git.html[documentation for release 1.5.2.5]
89
Junio C Hamanoed7f4f62007-05-20 09:09:0990* release notes for
Junio C Hamano3b178be2007-08-16 04:59:2791 link:RelNotes-1.5.2.5.txt[1.5.2.5],
Junio C Hamano235d53f2007-07-13 00:25:1592 link:RelNotes-1.5.2.4.txt[1.5.2.4],
Junio C Hamano1d90cb02007-07-03 07:05:3193 link:RelNotes-1.5.2.3.txt[1.5.2.3],
Junio C Hamano29b1b922007-06-16 16:30:2694 link:RelNotes-1.5.2.2.txt[1.5.2.2],
95 link:RelNotes-1.5.2.1.txt[1.5.2.1],
Junio C Hamanoed7f4f62007-05-20 09:09:0996 link:RelNotes-1.5.2.txt[1.5.2].
97
98* link:v1.5.1.6/git.html[documentation for release 1.5.1.6]
99
100* release notes for
101 link:RelNotes-1.5.1.6.txt[1.5.1.6],
102 link:RelNotes-1.5.1.5.txt[1.5.1.5],
Junio C Hamanoa9b8d242007-05-19 04:51:55103 link:RelNotes-1.5.1.4.txt[1.5.1.4],
104 link:RelNotes-1.5.1.3.txt[1.5.1.3],
105 link:RelNotes-1.5.1.2.txt[1.5.1.2],
106 link:RelNotes-1.5.1.1.txt[1.5.1.1],
107 link:RelNotes-1.5.1.txt[1.5.1].
Junio C Hamano91d44c52007-05-09 07:16:07108
Junio C Hamanoa9b8d242007-05-19 04:51:55109* link:v1.5.0.7/git.html[documentation for release 1.5.0.7]
Junio C Hamano91d44c52007-05-09 07:16:07110
Junio C Hamanoed7f4f62007-05-20 09:09:09111* release notes for
112 link:RelNotes-1.5.0.7.txt[1.5.0.7],
Junio C Hamanoa9b8d242007-05-19 04:51:55113 link:RelNotes-1.5.0.6.txt[1.5.0.6],
114 link:RelNotes-1.5.0.5.txt[1.5.0.5],
115 link:RelNotes-1.5.0.3.txt[1.5.0.3],
116 link:RelNotes-1.5.0.2.txt[1.5.0.2],
117 link:RelNotes-1.5.0.1.txt[1.5.0.1],
118 link:RelNotes-1.5.0.txt[1.5.0].
Junio C Hamanoe90436a2007-04-22 07:22:13119
Junio C Hamanoa9b8d242007-05-19 04:51:55120* documentation for release link:v1.4.4.4/git.html[1.4.4.4],
121 link:v1.3.3/git.html[1.3.3],
122 link:v1.2.6/git.html[1.2.6],
123 link:v1.0.13/git.html[1.0.13].
Junio C Hamano9d52e572007-02-13 23:48:20124
125============
126
127endif::stalenotes[]
128
Junio C Hamano1a4e8412005-12-27 08:17:23129OPTIONS
130-------
131--version::
Junio C Hamano01078922006-03-10 00:31:47132Prints the git suite version that the 'git' program came from.
Junio C Hamano1a4e8412005-12-27 08:17:23133
134--help::
Junio C Hamano01078922006-03-10 00:31:47135Prints the synopsis and a list of the most commonly used
Junio C Hamano58256872007-12-04 08:31:13136commands. If the option '--all' or '-a' is given then all
137available commands are printed. If a git command is named this
138option will bring up the manual page for that command.
Junio C Hamano0c0da5f2007-12-13 02:45:30139+
140Other options are available to control how the manual page is
Junio C Hamano35738e82008-01-07 07:55:46141displayed. See linkgit:git-help[1] for more information,
Junio C Hamanoba4b9282008-07-06 05:20:31142because `git --help ...` is converted internally into `git
143help ...`.
Junio C Hamano1a4e8412005-12-27 08:17:23144
145--exec-path::
Junio C Hamano01078922006-03-10 00:31:47146Path to wherever your core git programs are installed.
Junio C Hamano1a4e8412005-12-27 08:17:23147This can also be controlled by setting the GIT_EXEC_PATH
Junio C Hamanoba4b9282008-07-06 05:20:31148environment variable. If no path is given, 'git' will print
Junio C Hamano1a4e8412005-12-27 08:17:23149the current setting and then exit.
150
Junio C Hamanoeb415992008-06-08 22:49:47151-p::
152--paginate::
Junio C Hamanof870ef82006-07-29 09:10:13153Pipe all output into 'less' (or if set, $PAGER).
154
Junio C Hamanocae86272007-08-21 02:20:49155--no-pager::
156Do not pipe git output into a pager.
157
Junio C Hamanof870ef82006-07-29 09:10:13158--git-dir=<path>::
159Set the path to the repository. This can also be controlled by
Junio C Hamano7d575a52008-04-30 08:45:27160setting the GIT_DIR environment variable. It can be an absolute
161path or relative path to current working directory.
Junio C Hamanof870ef82006-07-29 09:10:13162
Junio C Hamanod526ba92007-07-02 00:17:42163--work-tree=<path>::
164Set the path to the working tree. The value will not be
165used in combination with repositories found automatically in
166a .git directory (i.e. $GIT_DIR is not set).
167This can also be controlled by setting the GIT_WORK_TREE
168environment variable and the core.worktree configuration
Junio C Hamano7d575a52008-04-30 08:45:27169variable. It can be an absolute path or relative path to
170the directory specified by --git-dir or GIT_DIR.
171Note: If --git-dir or GIT_DIR are specified but none of
172--work-tree, GIT_WORK_TREE and core.worktree is specified,
173the current working directory is regarded as the top directory
174of your working tree.
Junio C Hamanod526ba92007-07-02 00:17:42175
Junio C Hamanof870ef82006-07-29 09:10:13176--bare::
Junio C Hamanoc435b1c2007-08-28 06:25:35177Treat the repository as a bare repository. If GIT_DIR
178environment is not set, it is set to the current working
179directory.
180
Junio C Hamano1a4e8412005-12-27 08:17:23181
Junio C Hamanoe27fb932006-04-03 05:34:10182FURTHER DOCUMENTATION
183---------------------
Junio C Hamano1a4e8412005-12-27 08:17:23184
Junio C Hamanoe27fb932006-04-03 05:34:10185See the references above to get started using git. The following is
186probably more detail than necessary for a first-time user.
Junio C Hamano1a4e8412005-12-27 08:17:23187
Junio C Hamano597ffcf2007-09-17 17:33:15188The link:user-manual.html#git-concepts[git concepts chapter of the
Junio C Hamanofce7c7e2008-07-02 03:06:38189user-manual] and linkgit:gitcore-tutorial[7] both provide
Junio C Hamano597ffcf2007-09-17 17:33:15190introductions to the underlying git architecture.
Junio C Hamano1a4e8412005-12-27 08:17:23191
Junio C Hamanoe27fb932006-04-03 05:34:10192See also the link:howto-index.html[howto] documents for some useful
193examples.
Junio C Hamano1a4e8412005-12-27 08:17:23194
Junio C Hamanofce7c7e2008-07-02 03:06:38195The internals are documented in the
196link:technical/api-index.html[GIT API documentation].
Junio C Hamano3dac5042007-12-15 08:40:54197
Junio C Hamanoe27fb932006-04-03 05:34:10198GIT COMMANDS
199------------
Junio C Hamano1a4e8412005-12-27 08:17:23200
Junio C Hamanoe27fb932006-04-03 05:34:10201We divide git into high level ("porcelain") commands and low level
202("plumbing") commands.
Junio C Hamano1a4e8412005-12-27 08:17:23203
Junio C Hamanob19b4f02006-10-29 20:47:22204High-level commands (porcelain)
205-------------------------------
206
207We separate the porcelain commands into the main commands and some
208ancillary user utilities.
209
210Main porcelain commands
211~~~~~~~~~~~~~~~~~~~~~~~
212
Junio C Hamano7c73c662007-01-19 00:37:50213include::cmds-mainporcelain.txt[]
Junio C Hamanob19b4f02006-10-29 20:47:22214
215Ancillary Commands
216~~~~~~~~~~~~~~~~~~
217Manipulators:
218
Junio C Hamano7c73c662007-01-19 00:37:50219include::cmds-ancillarymanipulators.txt[]
Junio C Hamanob19b4f02006-10-29 20:47:22220
221Interrogators:
222
Junio C Hamano7c73c662007-01-19 00:37:50223include::cmds-ancillaryinterrogators.txt[]
Junio C Hamanob19b4f02006-10-29 20:47:22224
Junio C Hamano4ad294b2007-01-20 02:22:50225
226Interacting with Others
227~~~~~~~~~~~~~~~~~~~~~~~
228
229These commands are to interact with foreign SCM and with other
230people via patch over e-mail.
231
232include::cmds-foreignscminterface.txt[]
233
234
Junio C Hamanoe27fb932006-04-03 05:34:10235Low-level commands (plumbing)
236-----------------------------
Junio C Hamano1a4e8412005-12-27 08:17:23237
Junio C Hamanoe27fb932006-04-03 05:34:10238Although git includes its
239own porcelain layer, its low-level commands are sufficient to support
240development of alternative porcelains. Developers of such porcelains
Junio C Hamano35738e82008-01-07 07:55:46241might start by reading about linkgit:git-update-index[1] and
242linkgit:git-read-tree[1].
Junio C Hamano1a4e8412005-12-27 08:17:23243
Junio C Hamano4ad294b2007-01-20 02:22:50244The interface (input, output, set of options and the semantics)
245to these low-level commands are meant to be a lot more stable
246than Porcelain level commands, because these commands are
247primarily for scripted use. The interface to Porcelain commands
248on the other hand are subject to change in order to improve the
249end user experience.
250
251The following description divides
252the low-level commands into commands that manipulate objects (in
Junio C Hamanoe27fb932006-04-03 05:34:10253the repository, index, and working tree), commands that interrogate and
254compare objects, and commands that move objects and references between
255repositories.
Junio C Hamano1a4e8412005-12-27 08:17:23256
Junio C Hamano4ad294b2007-01-20 02:22:50257
Junio C Hamano1a4e8412005-12-27 08:17:23258Manipulation commands
259~~~~~~~~~~~~~~~~~~~~~
Junio C Hamano1a4e8412005-12-27 08:17:23260
Junio C Hamano7c73c662007-01-19 00:37:50261include::cmds-plumbingmanipulators.txt[]
Junio C Hamano1a4e8412005-12-27 08:17:23262
263
264Interrogation commands
265~~~~~~~~~~~~~~~~~~~~~~
266
Junio C Hamano7c73c662007-01-19 00:37:50267include::cmds-plumbinginterrogators.txt[]
Junio C Hamano1a4e8412005-12-27 08:17:23268
269In general, the interrogate commands do not touch the files in
270the working tree.
271
272
273Synching repositories
274~~~~~~~~~~~~~~~~~~~~~
275
Junio C Hamano7c73c662007-01-19 00:37:50276include::cmds-synchingrepositories.txt[]
Junio C Hamano1a4e8412005-12-27 08:17:23277
Junio C Hamano4ad294b2007-01-20 02:22:50278The following are helper programs used by the above; end users
279typically do not use them directly.
280
281include::cmds-synchelpers.txt[]
282
283
284Internal helper commands
285~~~~~~~~~~~~~~~~~~~~~~~~
286
287These are internal helper commands used by other commands; end
288users typically do not use them directly.
289
290include::cmds-purehelpers.txt[]
291
Junio C Hamano1a4e8412005-12-27 08:17:23292
Junio C Hamano1a4e8412005-12-27 08:17:23293Configuration Mechanism
294-----------------------
295
296Starting from 0.99.9 (actually mid 0.99.8.GIT), `.git/config` file
297is used to hold per-repository configuration options. It is a
Junio C Hamano51c2ab02006-07-09 20:38:54298simple text file modeled after `.ini` format familiar to some
Junio C Hamano1a4e8412005-12-27 08:17:23299people. Here is an example:
300
301------------
302#
303# A '#' or ';' character indicates a comment.
304#
305
306; core variables
307[core]
308; Don't trust file modes
309filemode = false
310
311; user identity
312[user]
313name = "Junio C Hamano"
314email = "junkio@twinsun.com"
315
316------------
317
318Various commands read from the configuration file and adjust
319their operation accordingly.
320
321
322Identifier Terminology
323----------------------
324<object>::
325Indicates the object name for any type of object.
326
327<blob>::
328Indicates a blob object name.
329
330<tree>::
331Indicates a tree object name.
332
333<commit>::
334Indicates a commit object name.
335
336<tree-ish>::
337Indicates a tree, commit or tag object name. A
338command that takes a <tree-ish> argument ultimately wants to
339operate on a <tree> object but automatically dereferences
340<commit> and <tag> objects that point at a <tree>.
341
Junio C Hamano60f8aa82007-03-06 09:58:26342<commit-ish>::
343Indicates a commit or tag object name. A
344command that takes a <commit-ish> argument ultimately wants to
345operate on a <commit> object but automatically dereferences
346<tag> objects that point at a <commit>.
347
Junio C Hamano1a4e8412005-12-27 08:17:23348<type>::
349Indicates that an object type is required.
350Currently one of: `blob`, `tree`, `commit`, or `tag`.
351
352<file>::
353Indicates a filename - almost always relative to the
354root of the tree structure `GIT_INDEX_FILE` describes.
355
356Symbolic Identifiers
357--------------------
358Any git command accepting any <object> can also use the following
359symbolic notation:
360
361HEAD::
362indicates the head of the current branch (i.e. the
363contents of `$GIT_DIR/HEAD`).
364
365<tag>::
366a valid tag 'name'
367(i.e. the contents of `$GIT_DIR/refs/tags/<tag>`).
368
369<head>::
370a valid head 'name'
371(i.e. the contents of `$GIT_DIR/refs/heads/<head>`).
372
Junio C Hamanoff4b4312006-10-25 22:55:31373For a more complete list of ways to spell object names, see
Junio C Hamano35738e82008-01-07 07:55:46374"SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1].
Junio C Hamanoff4b4312006-10-25 22:55:31375
Junio C Hamano1a4e8412005-12-27 08:17:23376
377File/Directory Structure
378------------------------
379
Junio C Hamanofce7c7e2008-07-02 03:06:38380Please see the linkgit:gitrepository-layout[5] document.
Junio C Hamano1a4e8412005-12-27 08:17:23381
Junio C Hamanofce7c7e2008-07-02 03:06:38382Read linkgit:githooks[5] for more details about each hook.
Junio C Hamano818f7d62006-03-26 01:49:30383
Junio C Hamano1a4e8412005-12-27 08:17:23384Higher level SCMs may provide and manage additional information in the
385`$GIT_DIR`.
386
387
388Terminology
389-----------
Junio C Hamanofce7c7e2008-07-02 03:06:38390Please see linkgit:gitglossary[7].
Junio C Hamano1a4e8412005-12-27 08:17:23391
392
393Environment Variables
394---------------------
395Various git commands use the following environment variables:
396
397The git Repository
398~~~~~~~~~~~~~~~~~~
399These environment variables apply to 'all' core git commands. Nb: it
400is worth noting that they may be used/overridden by SCMS sitting above
401git so take care if using Cogito etc.
402
403'GIT_INDEX_FILE'::
404This environment allows the specification of an alternate
405index file. If not specified, the default of `$GIT_DIR/index`
406is used.
407
408'GIT_OBJECT_DIRECTORY'::
409If the object storage directory is specified via this
410environment variable then the sha1 directories are created
411underneath - otherwise the default `$GIT_DIR/objects`
412directory is used.
413
414'GIT_ALTERNATE_OBJECT_DIRECTORIES'::
415Due to the immutable nature of git objects, old objects can be
416archived into shared, read-only directories. This variable
Junio C Hamano05bf9c52008-07-03 09:21:58417specifies a ":" separated (on Windows ";" separated) list
418of git object directories which can be used to search for git
419objects. New objects will not be written to these directories.
Junio C Hamano1a4e8412005-12-27 08:17:23420
421'GIT_DIR'::
422If the 'GIT_DIR' environment variable is set then it
423specifies a path to use instead of the default `.git`
424for the base of the repository.
425
Junio C Hamanod526ba92007-07-02 00:17:42426'GIT_WORK_TREE'::
427Set the path to the working tree. The value will not be
428used in combination with repositories found automatically in
429a .git directory (i.e. $GIT_DIR is not set).
430This can also be controlled by the '--work-tree' command line
431option and the core.worktree configuration variable.
432
Junio C Hamano15048272008-07-07 22:10:48433'GIT_CEILING_DIRECTORIES'::
434This should be a colon-separated list of absolute paths.
435If set, it is a list of directories that git should not chdir
436up into while looking for a repository directory.
437It will not exclude the current working directory or
438a GIT_DIR set on the command line or in the environment.
439(Useful for excluding slow-loading network directories.)
440
Junio C Hamano1a4e8412005-12-27 08:17:23441git Commits
442~~~~~~~~~~~
443'GIT_AUTHOR_NAME'::
444'GIT_AUTHOR_EMAIL'::
445'GIT_AUTHOR_DATE'::
446'GIT_COMMITTER_NAME'::
447'GIT_COMMITTER_EMAIL'::
Junio C Hamano469d60e2007-04-29 18:30:34448'GIT_COMMITTER_DATE'::
449'EMAIL'::
Junio C Hamano35738e82008-01-07 07:55:46450see linkgit:git-commit-tree[1]
Junio C Hamano1a4e8412005-12-27 08:17:23451
452git Diffs
453~~~~~~~~~
454'GIT_DIFF_OPTS'::
Junio C Hamano1c437122006-11-28 02:22:25455Only valid setting is "--unified=??" or "-u??" to set the
456number of context lines shown when a unified diff is created.
457This takes precedence over any "-U" or "--unified" option
458value passed on the git diff command line.
459
Junio C Hamano1a4e8412005-12-27 08:17:23460'GIT_EXTERNAL_DIFF'::
Junio C Hamano1c437122006-11-28 02:22:25461When the environment variable 'GIT_EXTERNAL_DIFF' is set, the
462program named by it is called, instead of the diff invocation
463described above. For a path that is added, removed, or modified,
464 'GIT_EXTERNAL_DIFF' is called with 7 parameters:
465
466path old-file old-hex old-mode new-file new-hex new-mode
467+
468where:
469
470<old|new>-file:: are files GIT_EXTERNAL_DIFF can use to read the
471 contents of <old|new>,
472<old|new>-hex:: are the 40-hexdigit SHA1 hashes,
473<old|new>-mode:: are the octal representation of the file modes.
474
475+
476The file parameters can point at the user's working file
477(e.g. `new-file` in "git-diff-files"), `/dev/null` (e.g. `old-file`
478when a new file is added), or a temporary file (e.g. `old-file` in the
479index). 'GIT_EXTERNAL_DIFF' should not worry about unlinking the
480temporary file --- it is removed when 'GIT_EXTERNAL_DIFF' exits.
481+
482For a path that is unmerged, 'GIT_EXTERNAL_DIFF' is called with 1
483parameter, <path>.
Junio C Hamano1a4e8412005-12-27 08:17:23484
Junio C Hamano7ccb9fd2006-07-15 01:38:40485other
486~~~~~
Junio C Hamano1e6e0062007-07-13 05:33:25487'GIT_MERGE_VERBOSITY'::
488A number controlling the amount of output shown by
489the recursive merge strategy. Overrides merge.verbosity.
Junio C Hamano35738e82008-01-07 07:55:46490See linkgit:git-merge[1]
Junio C Hamano1e6e0062007-07-13 05:33:25491
Junio C Hamano85e45fa2006-08-13 07:47:41492'GIT_PAGER'::
Junio C Hamanof6002a92007-07-20 10:28:22493This environment variable overrides `$PAGER`. If it is set
494to an empty string or to the value "cat", git will not launch
495a pager.
Junio C Hamano85e45fa2006-08-13 07:47:41496
Junio C Hamano4cd1c0e2007-08-06 04:39:14497'GIT_SSH'::
Junio C Hamanoba4b9282008-07-06 05:20:31498If this environment variable is set then 'git-fetch'
499and 'git-push' will use this command instead
500of 'ssh' when they need to connect to a remote system.
Junio C Hamanofce7c7e2008-07-02 03:06:38501The '$GIT_SSH' command will be given exactly two arguments:
Junio C Hamano4cd1c0e2007-08-06 04:39:14502the 'username@host' (or just 'host') from the URL and the
503shell command to execute on that remote system.
504+
505To pass options to the program that you want to list in GIT_SSH
506you will need to wrap the program and options into a shell script,
507then set GIT_SSH to refer to the shell script.
508+
509Usually it is easier to configure any desired options through your
510personal `.ssh/config` file. Please consult your ssh documentation
511for further details.
512
Junio C Hamano401939f2007-07-01 06:34:30513'GIT_FLUSH'::
514If this environment variable is set to "1", then commands such
Junio C Hamanoba4b9282008-07-06 05:20:31515as 'git-blame' (in incremental mode), 'git-rev-list', 'git-log',
516and 'git-whatchanged' will force a flush of the output stream
Junio C Hamano401939f2007-07-01 06:34:30517after each commit-oriented record have been flushed. If this
518variable is set to "0", the output of these commands will be done
519using completely buffered I/O. If this environment variable is
520not set, git will choose buffered or record-oriented flushing
521based on whether stdout appears to be redirected to a file or not.
522
Junio C Hamano7ccb9fd2006-07-15 01:38:40523'GIT_TRACE'::
Junio C Hamanoef4b48b2006-09-04 10:08:34524If this variable is set to "1", "2" or "true" (comparison
525is case insensitive), git will print `trace:` messages on
Junio C Hamano7ccb9fd2006-07-15 01:38:40526stderr telling about alias expansion, built-in command
527execution and external command execution.
Junio C Hamanoef4b48b2006-09-04 10:08:34528If this variable is set to an integer value greater than 1
529and lower than 10 (strictly) then git will interpret this
530value as an open file descriptor and will try to write the
531trace messages into this file descriptor.
532Alternatively, if this variable is set to an absolute path
533(starting with a '/' character), git will interpret this
534as a file path and will try to write the trace messages
535into it.
Junio C Hamano7ccb9fd2006-07-15 01:38:40536
Junio C Hamano1a4e8412005-12-27 08:17:23537Discussion[[Discussion]]
538------------------------
Junio C Hamano597ffcf2007-09-17 17:33:15539
540More detail on the following is available from the
541link:user-manual.html#git-concepts[git concepts chapter of the
Junio C Hamanofce7c7e2008-07-02 03:06:38542user-manual] and linkgit:gitcore-tutorial[7].
Junio C Hamano597ffcf2007-09-17 17:33:15543
544A git project normally consists of a working directory with a ".git"
545subdirectory at the top level. The .git directory contains, among other
546things, a compressed object database representing the complete history
547of the project, an "index" file which links that history to the current
548contents of the working tree, and named pointers into that history such
549as tags and branch heads.
550
551The object database contains objects of three main types: blobs, which
552hold file data; trees, which point to blobs and other trees to build up
Junio C Hamanofe986052007-12-19 07:33:38553directory hierarchies; and commits, which each reference a single tree
Junio C Hamano597ffcf2007-09-17 17:33:15554and some number of parent commits.
555
556The commit, equivalent to what other systems call a "changeset" or
557"version", represents a step in the project's history, and each parent
558represents an immediately preceding step. Commits with more than one
559parent represent merges of independent lines of development.
560
561All objects are named by the SHA1 hash of their contents, normally
562written as a string of 40 hex digits. Such names are globally unique.
563The entire history leading up to a commit can be vouched for by signing
564just that commit. A fourth object type, the tag, is provided for this
565purpose.
566
567When first created, objects are stored in individual files, but for
568efficiency may later be compressed together into "pack files".
569
570Named pointers called refs mark interesting points in history. A ref
571may contain the SHA1 name of an object or the name of another ref. Refs
572with names beginning `ref/head/` contain the SHA1 name of the most
Junio C Hamanofe986052007-12-19 07:33:38573recent commit (or "head") of a branch under development. SHA1 names of
Junio C Hamano597ffcf2007-09-17 17:33:15574tags of interest are stored under `ref/tags/`. A special ref named
575`HEAD` contains the name of the currently checked-out branch.
576
577The index file is initialized with a list of all paths and, for each
578path, a blob object and a set of attributes. The blob object represents
579the contents of the file as of the head of the current branch. The
580attributes (last modified time, size, etc.) are taken from the
581corresponding file in the working tree. Subsequent changes to the
582working tree can be found by comparing these attributes. The index may
583be updated with new content, and new commits may be created from the
584content stored in the index.
585
586The index is also capable of storing multiple entries (called "stages")
587for a given pathname. These stages are used to hold the various
588unmerged version of a file when a merge is in progress.
Junio C Hamano1a4e8412005-12-27 08:17:23589
590Authors
591-------
592* git's founding father is Linus Torvalds <torvalds@osdl.org>.
Junio C Hamanodbb64592007-09-01 11:17:39593* The current git nurse is Junio C Hamano <gitster@pobox.com>.
Junio C Hamanoe0facb92007-12-05 10:59:48594* The git potty was written by Andreas Ericsson <ae@op5.se>.
Junio C Hamano1a4e8412005-12-27 08:17:23595* General upbringing is handled by the git-list <git@vger.kernel.org>.
596
597Documentation
598--------------
599The documentation for git suite was started by David Greaves
600<david@dgreaves.com>, and later enhanced greatly by the
601contributors on the git-list <git@vger.kernel.org>.
602
Junio C Hamano9e1793f2008-06-02 07:31:16603SEE ALSO
604--------
605linkgit:gittutorial[7], linkgit:gittutorial-2[7],
Junio C Hamanoaf1987f2008-08-03 07:58:19606link:everyday.html[Everyday Git], linkgit:gitcvs-migration[7],
Junio C Hamano9e1793f2008-06-02 07:31:16607linkgit:gitglossary[7], linkgit:gitcore-tutorial[7],
Junio C Hamanofa3ff872008-07-03 01:48:08608linkgit:gitcli[7], link:user-manual.html[The Git User's Manual]
Junio C Hamano9e1793f2008-06-02 07:31:16609
Junio C Hamano1a4e8412005-12-27 08:17:23610GIT
611---
Junio C Hamanof7c042d2008-06-06 22:50:53612Part of the linkgit:git[1] suite