blob: 8ad29e61a950c2cb1f33779977a33c63ae0df33b [file] [log] [blame]
Junio C Hamano3d5b41f2007-03-26 02:33:411[[def_alternate_object_database]]alternate object database::
Junio C Hamano75485c82007-05-19 04:20:332Via the alternates mechanism, a <<def_repository,repository>>
3can inherit part of its <<def_object_database,object database>>
Junio C Hamanoc8c398a2014-06-16 21:14:054from another object database, which is called an "alternate".
Junio C Hamano1a4e8412005-12-27 08:17:235
Junio C Hamano3d5b41f2007-03-26 02:33:416[[def_bare_repository]]bare repository::
Junio C Hamano75485c82007-05-19 04:20:337A bare repository is normally an appropriately
Junio C Hamano3d5b41f2007-03-26 02:33:418named <<def_directory,directory>> with a `.git` suffix that does not
9have a locally checked-out copy of any of the files under
Junio C Hamano076ffcc2013-02-06 05:13:2110revision control. That is, all of the Git
Junio C Hamano3d5b41f2007-03-26 02:33:4111administrative and control files that would normally be present in the
12hidden `.git` sub-directory are directly present in the
13`repository.git` directory instead,
14and no other files are present and checked out. Usually publishers of
15public repositories make bare repositories available.
Junio C Hamano1a4e8412005-12-27 08:17:2316
Junio C Hamano3d5b41f2007-03-26 02:33:4117[[def_blob_object]]blob object::
18Untyped <<def_object,object>>, e.g. the contents of a file.
Junio C Hamano1a4e8412005-12-27 08:17:2319
Junio C Hamano3d5b41f2007-03-26 02:33:4120[[def_branch]]branch::
Junio C Hamano75485c82007-05-19 04:20:3321A "branch" is an active line of development. The most recent
22<<def_commit,commit>> on a branch is referred to as the tip of
23that branch. The tip of the branch is referenced by a branch
24<<def_head,head>>, which moves forward as additional development
Junio C Hamano076ffcc2013-02-06 05:13:2125is done on the branch. A single Git
Junio C Hamano75485c82007-05-19 04:20:3326<<def_repository,repository>> can track an arbitrary number of
27branches, but your <<def_working_tree,working tree>> is
28associated with just one of them (the "current" or "checked out"
29branch), and <<def_HEAD,HEAD>> points to that branch.
Junio C Hamano88a3a072006-05-04 08:01:4330
Junio C Hamano3d5b41f2007-03-26 02:33:4131[[def_cache]]cache::
32Obsolete for: <<def_index,index>>.
Junio C Hamano88a3a072006-05-04 08:01:4333
Junio C Hamano3d5b41f2007-03-26 02:33:4134[[def_chain]]chain::
35A list of objects, where each <<def_object,object>> in the list contains
36a reference to its successor (for example, the successor of a
Junio C Hamano36460982007-05-27 04:29:1237<<def_commit,commit>> could be one of its <<def_parent,parents>>).
Junio C Hamano88a3a072006-05-04 08:01:4338
Junio C Hamano3d5b41f2007-03-26 02:33:4139[[def_changeset]]changeset::
Junio C Hamano076ffcc2013-02-06 05:13:2140BitKeeper/cvsps speak for "<<def_commit,commit>>". Since Git does not
Junio C Hamano3d5b41f2007-03-26 02:33:4141store changes, but states, it really does not make sense to use the term
Junio C Hamano076ffcc2013-02-06 05:13:2142"changesets" with Git.
Junio C Hamano88a3a072006-05-04 08:01:4343
Junio C Hamano3d5b41f2007-03-26 02:33:4144[[def_checkout]]checkout::
Junio C Hamanoa14a4032008-03-25 09:11:0245The action of updating all or part of the
46<<def_working_tree,working tree>> with a <<def_tree_object,tree object>>
47or <<def_blob_object,blob>> from the
48<<def_object_database,object database>>, and updating the
49<<def_index,index>> and <<def_HEAD,HEAD>> if the whole working tree has
50been pointed at a new <<def_branch,branch>>.
Junio C Hamano88a3a072006-05-04 08:01:4351
Junio C Hamano3d5b41f2007-03-26 02:33:4152[[def_cherry-picking]]cherry-picking::
53In <<def_SCM,SCM>> jargon, "cherry pick" means to choose a subset of
54changes out of a series of changes (typically commits) and record them
Junio C Hamano076ffcc2013-02-06 05:13:2155as a new series of changes on top of a different codebase. In Git, this is
Junio C Hamano764a6672007-10-23 01:23:3156performed by the "git cherry-pick" command to extract the change introduced
Junio C Hamano3d5b41f2007-03-26 02:33:4157by an existing <<def_commit,commit>> and to record it based on the tip
Junio C Hamano75485c82007-05-19 04:20:3358of the current <<def_branch,branch>> as a new commit.
Junio C Hamano88a3a072006-05-04 08:01:4359
Junio C Hamano3d5b41f2007-03-26 02:33:4160[[def_clean]]clean::
Junio C Hamano75485c82007-05-19 04:20:3361A <<def_working_tree,working tree>> is clean, if it
Junio C Hamano3d5b41f2007-03-26 02:33:4162corresponds to the <<def_revision,revision>> referenced by the current
63<<def_head,head>>. Also see "<<def_dirty,dirty>>".
Junio C Hamano88a3a072006-05-04 08:01:4364
Junio C Hamano3d5b41f2007-03-26 02:33:4165[[def_commit]]commit::
Junio C Hamano75485c82007-05-19 04:20:3366As a noun: A single point in the
Junio C Hamano076ffcc2013-02-06 05:13:2167Git history; the entire history of a project is represented as a
Junio C Hamano75485c82007-05-19 04:20:3368set of interrelated commits. The word "commit" is often
Junio C Hamano076ffcc2013-02-06 05:13:2169used by Git in the same places other revision control systems
Junio C Hamano75485c82007-05-19 04:20:3370use the words "revision" or "version". Also used as a short
71hand for <<def_commit_object,commit object>>.
72+
73As a verb: The action of storing a new snapshot of the project's
Junio C Hamano076ffcc2013-02-06 05:13:2174state in the Git history, by creating a new commit representing the current
Junio C Hamano75485c82007-05-19 04:20:3375state of the <<def_index,index>> and advancing <<def_HEAD,HEAD>>
76to point at the new commit.
Junio C Hamano88a3a072006-05-04 08:01:4377
Junio C Hamano3d5b41f2007-03-26 02:33:4178[[def_commit_object]]commit object::
79An <<def_object,object>> which contains the information about a
Junio C Hamano36460982007-05-27 04:29:1280particular <<def_revision,revision>>, such as <<def_parent,parents>>, committer,
Junio C Hamano3d5b41f2007-03-26 02:33:4181author, date and the <<def_tree_object,tree object>> which corresponds
82to the top <<def_directory,directory>> of the stored
Junio C Hamano36460982007-05-27 04:29:1283revision.
Junio C Hamano1a4e8412005-12-27 08:17:2384
Junio C Hamanoe6f28d02013-09-17 21:34:0085[[def_commit-ish]]commit-ish (also committish)::
86A <<def_commit_object,commit object>> or an
87<<def_object,object>> that can be recursively dereferenced to
88a commit object.
89The following are all commit-ishes:
90a commit object,
91a <<def_tag_object,tag object>> that points to a commit
92object,
93a tag object that points to a tag object that points to a
94commit object,
95etc.
96
Junio C Hamano076ffcc2013-02-06 05:13:2197[[def_core_git]]core Git::
98Fundamental data structures and utilities of Git. Exposes only limited
Junio C Hamano3d5b41f2007-03-26 02:33:4199source code management tools.
Junio C Hamano1a4e8412005-12-27 08:17:23100
Junio C Hamano3d5b41f2007-03-26 02:33:41101[[def_DAG]]DAG::
Junio C Hamano9e1793f2008-06-02 07:31:16102Directed acyclic graph. The <<def_commit_object,commit objects>> form a
Junio C Hamano3d5b41f2007-03-26 02:33:41103directed acyclic graph, because they have parents (directed), and the
Junio C Hamano9e1793f2008-06-02 07:31:16104graph of commit objects is acyclic (there is no <<def_chain,chain>>
105which begins and ends with the same <<def_object,object>>).
Junio C Hamanoaa83a7d2007-03-05 02:37:29106
Junio C Hamano3d5b41f2007-03-26 02:33:41107[[def_dangling_object]]dangling object::
108An <<def_unreachable_object,unreachable object>> which is not
109<<def_reachable,reachable>> even from other unreachable objects; a
Junio C Hamano75485c82007-05-19 04:20:33110dangling object has no references to it from any
Junio C Hamano3d5b41f2007-03-26 02:33:41111reference or <<def_object,object>> in the <<def_repository,repository>>.
112
Junio C Hamano75485c82007-05-19 04:20:33113[[def_detached_HEAD]]detached HEAD::
114Normally the <<def_HEAD,HEAD>> stores the name of a
Junio C Hamanoea3b7522013-04-18 19:37:53115<<def_branch,branch>>, and commands that operate on the
116history HEAD represents operate on the history leading to the
117tip of the branch the HEAD points at. However, Git also
118allows you to <<def_checkout,check out>> an arbitrary
119<<def_commit,commit>> that isn't necessarily the tip of any
120particular branch. The HEAD in such a state is called
121"detached".
122+
123Note that commands that operate on the history of the current branch
124(e.g. `git commit` to build a new history on top of it) still work
125while the HEAD is detached. They update the HEAD to point at the tip
126of the updated history without affecting any branch. Commands that
127update or inquire information _about_ the current branch (e.g. `git
Junio C Hamano8401f142013-07-12 22:47:46128branch --set-upstream-to` that sets what remote-tracking branch the
Junio C Hamanoea3b7522013-04-18 19:37:53129current branch integrates with) obviously do not work, as there is no
130(real) current branch to ask about in this state.
Junio C Hamano75485c82007-05-19 04:20:33131
Junio C Hamano3d5b41f2007-03-26 02:33:41132[[def_directory]]directory::
Junio C Hamano88a3a072006-05-04 08:01:43133The list you get with "ls" :-)
134
Junio C Hamano3d5b41f2007-03-26 02:33:41135[[def_dirty]]dirty::
Junio C Hamano75485c82007-05-19 04:20:33136A <<def_working_tree,working tree>> is said to be "dirty" if
Junio C Hamano36460982007-05-27 04:29:12137it contains modifications which have not been <<def_commit,committed>> to the current
Junio C Hamano3d5b41f2007-03-26 02:33:41138<<def_branch,branch>>.
139
Junio C Hamano36460982007-05-27 04:29:12140[[def_evil_merge]]evil merge::
141An evil merge is a <<def_merge,merge>> that introduces changes that
142do not appear in any <<def_parent,parent>>.
143
Junio C Hamano3f680f32009-11-16 02:10:54144[[def_fast_forward]]fast-forward::
Junio C Hamano3d5b41f2007-03-26 02:33:41145A fast-forward is a special type of <<def_merge,merge>> where you have a
146<<def_revision,revision>> and you are "merging" another
147<<def_branch,branch>>'s changes that happen to be a descendant of what
Junio C Hamano74fd0fc2016-05-10 21:23:56148you have. In such a case, you do not make a new <<def_merge,merge>>
Junio C Hamano3d5b41f2007-03-26 02:33:41149<<def_commit,commit>> but instead just update to his
Junio C Hamano75485c82007-05-19 04:20:33150revision. This will happen frequently on a
Junio C Hamano97bcb482010-11-25 03:16:07151<<def_remote_tracking_branch,remote-tracking branch>> of a remote
Junio C Hamano3d5b41f2007-03-26 02:33:41152<<def_repository,repository>>.
Junio C Hamano88a3a072006-05-04 08:01:43153
Junio C Hamano3d5b41f2007-03-26 02:33:41154[[def_fetch]]fetch::
155Fetching a <<def_branch,branch>> means to get the
Junio C Hamano75485c82007-05-19 04:20:33156branch's <<def_head_ref,head ref>> from a remote
157<<def_repository,repository>>, to find out which objects are
158missing from the local <<def_object_database,object database>>,
Junio C Hamano35738e82008-01-07 07:55:46159and to get them, too. See also linkgit:git-fetch[1].
Junio C Hamano88a3a072006-05-04 08:01:43160
Junio C Hamano3d5b41f2007-03-26 02:33:41161[[def_file_system]]file system::
Junio C Hamano076ffcc2013-02-06 05:13:21162Linus Torvalds originally designed Git to be a user space file system,
Junio C Hamano3d5b41f2007-03-26 02:33:41163i.e. the infrastructure to hold files and directories. That ensured the
Junio C Hamano076ffcc2013-02-06 05:13:21164efficiency and speed of Git.
Junio C Hamano88a3a072006-05-04 08:01:43165
Junio C Hamano076ffcc2013-02-06 05:13:21166[[def_git_archive]]Git archive::
Junio C Hamano3d5b41f2007-03-26 02:33:41167Synonym for <<def_repository,repository>> (for arch people).
Junio C Hamano88a3a072006-05-04 08:01:43168
Junio C Hamano076ffcc2013-02-06 05:13:21169[[def_gitfile]]gitfile::
170A plain file `.git` at the root of a working tree that
171points at the directory that is the real repository.
172
Junio C Hamano3d5b41f2007-03-26 02:33:41173[[def_grafts]]grafts::
174Grafts enables two otherwise different lines of development to be joined
175together by recording fake ancestry information for commits. This way
Junio C Hamano076ffcc2013-02-06 05:13:21176you can make Git pretend the set of <<def_parent,parents>> a <<def_commit,commit>> has
Junio C Hamano75485c82007-05-19 04:20:33177is different from what was recorded when the commit was
Junio C Hamano3d5b41f2007-03-26 02:33:41178created. Configured via the `.git/info/grafts` file.
Junio C Hamano3b0cdc22014-03-18 22:06:16179+
180Note that the grafts mechanism is outdated and can lead to problems
181transferring objects between repositories; see linkgit:git-replace[1]
182for a more flexible and robust system to do the same thing.
Junio C Hamano33db4372006-06-07 19:51:45183
Junio C Hamano3d5b41f2007-03-26 02:33:41184[[def_hash]]hash::
Junio C Hamanoe3f080d2013-04-22 02:27:13185In Git's context, synonym for <<def_object_name,object name>>.
Junio C Hamano88a3a072006-05-04 08:01:43186
Junio C Hamano3d5b41f2007-03-26 02:33:41187[[def_head]]head::
Junio C Hamano36460982007-05-27 04:29:12188A <<def_ref,named reference>> to the <<def_commit,commit>> at the tip of a
Junio C Hamano360e3a12011-07-13 23:51:56189<<def_branch,branch>>. Heads are stored in a file in
190`$GIT_DIR/refs/heads/` directory, except when using packed refs. (See
Junio C Hamano35738e82008-01-07 07:55:46191linkgit:git-pack-refs[1].)
Junio C Hamano75485c82007-05-19 04:20:33192
193[[def_HEAD]]HEAD::
Junio C Hamano36460982007-05-27 04:29:12194The current <<def_branch,branch>>. In more detail: Your <<def_working_tree,
Junio C Hamano75485c82007-05-19 04:20:33195working tree>> is normally derived from the state of the tree
196referred to by HEAD. HEAD is a reference to one of the
197<<def_head,heads>> in your repository, except when using a
Junio C Hamano360e3a12011-07-13 23:51:56198<<def_detached_HEAD,detached HEAD>>, in which case it directly
199references an arbitrary commit.
Junio C Hamano88a3a072006-05-04 08:01:43200
Junio C Hamano3d5b41f2007-03-26 02:33:41201[[def_head_ref]]head ref::
Junio C Hamano75485c82007-05-19 04:20:33202A synonym for <<def_head,head>>.
Junio C Hamano88a3a072006-05-04 08:01:43203
Junio C Hamano3d5b41f2007-03-26 02:33:41204[[def_hook]]hook::
Junio C Hamano076ffcc2013-02-06 05:13:21205During the normal execution of several Git commands, call-outs are made
Junio C Hamano3d5b41f2007-03-26 02:33:41206to optional scripts that allow a developer to add functionality or
207checking. Typically, the hooks allow for a command to be pre-verified
208and potentially aborted, and allow for a post-notification after the
Junio C Hamano75485c82007-05-19 04:20:33209operation is done. The hook scripts are found in the
Junio C Hamano36460982007-05-27 04:29:12210`$GIT_DIR/hooks/` directory, and are enabled by simply
Junio C Hamano116db352008-12-17 19:48:40211removing the `.sample` suffix from the filename. In earlier versions
Junio C Hamano076ffcc2013-02-06 05:13:21212of Git you had to make them executable.
Junio C Hamano88a3a072006-05-04 08:01:43213
Junio C Hamano3d5b41f2007-03-26 02:33:41214[[def_index]]index::
215A collection of files with stat information, whose contents are stored
Junio C Hamano36460982007-05-27 04:29:12216as objects. The index is a stored version of your
217<<def_working_tree,working tree>>. Truth be told, it can also contain a second, and even
218a third version of a working tree, which are used
219when <<def_merge,merging>>.
Junio C Hamano1a4e8412005-12-27 08:17:23220
Junio C Hamano3d5b41f2007-03-26 02:33:41221[[def_index_entry]]index entry::
222The information regarding a particular file, stored in the
Junio C Hamano75485c82007-05-19 04:20:33223<<def_index,index>>. An index entry can be unmerged, if a
224<<def_merge,merge>> was started, but not yet finished (i.e. if
225the index contains multiple versions of that file).
Junio C Hamano1a4e8412005-12-27 08:17:23226
Junio C Hamano3d5b41f2007-03-26 02:33:41227[[def_master]]master::
Junio C Hamano75485c82007-05-19 04:20:33228The default development <<def_branch,branch>>. Whenever you
Junio C Hamano076ffcc2013-02-06 05:13:21229create a Git <<def_repository,repository>>, a branch named
Junio C Hamano75485c82007-05-19 04:20:33230"master" is created, and becomes the active branch. In most
231cases, this contains the local development, though that is
232purely by convention and is not required.
Junio C Hamano1a4e8412005-12-27 08:17:23233
Junio C Hamano3d5b41f2007-03-26 02:33:41234[[def_merge]]merge::
Junio C Hamano75485c82007-05-19 04:20:33235As a verb: To bring the contents of another
236<<def_branch,branch>> (possibly from an external
237<<def_repository,repository>>) into the current branch. In the
238case where the merged-in branch is from a different repository,
239this is done by first <<def_fetch,fetching>> the remote branch
240and then merging the result into the current branch. This
241combination of fetch and merge operations is called a
242<<def_pull,pull>>. Merging is performed by an automatic process
243that identifies changes made since the branches diverged, and
244then applies all those changes together. In cases where changes
245conflict, manual intervention may be required to complete the
246merge.
247+
Junio C Hamano3f680f32009-11-16 02:10:54248As a noun: unless it is a <<def_fast_forward,fast-forward>>, a
Junio C Hamano75485c82007-05-19 04:20:33249successful merge results in the creation of a new <<def_commit,commit>>
250representing the result of the merge, and having as
251<<def_parent,parents>> the tips of the merged <<def_branch,branches>>.
252This commit is referred to as a "merge commit", or sometimes just a
253"merge".
Junio C Hamano1a4e8412005-12-27 08:17:23254
Junio C Hamano3d5b41f2007-03-26 02:33:41255[[def_object]]object::
Junio C Hamano076ffcc2013-02-06 05:13:21256The unit of storage in Git. It is uniquely identified by the
Junio C Hamanoe3f080d2013-04-22 02:27:13257<<def_SHA1,SHA-1>> of its contents. Consequently, an
Junio C Hamano75485c82007-05-19 04:20:33258object can not be changed.
Junio C Hamano1a4e8412005-12-27 08:17:23259
Junio C Hamano3d5b41f2007-03-26 02:33:41260[[def_object_database]]object database::
261Stores a set of "objects", and an individual <<def_object,object>> is
262identified by its <<def_object_name,object name>>. The objects usually
263live in `$GIT_DIR/objects/`.
Junio C Hamano1a4e8412005-12-27 08:17:23264
Junio C Hamano3d5b41f2007-03-26 02:33:41265[[def_object_identifier]]object identifier::
266Synonym for <<def_object_name,object name>>.
Junio C Hamano1a4e8412005-12-27 08:17:23267
Junio C Hamano3d5b41f2007-03-26 02:33:41268[[def_object_name]]object name::
Junio C Hamanoe3f080d2013-04-22 02:27:13269The unique identifier of an <<def_object,object>>. The
270object name is usually represented by a 40 character
271hexadecimal string. Also colloquially called <<def_SHA1,SHA-1>>.
Junio C Hamano1a4e8412005-12-27 08:17:23272
Junio C Hamano3d5b41f2007-03-26 02:33:41273[[def_object_type]]object type::
Junio C Hamano9e1793f2008-06-02 07:31:16274One of the identifiers "<<def_commit_object,commit>>",
275"<<def_tree_object,tree>>", "<<def_tag_object,tag>>" or
276"<<def_blob_object,blob>>" describing the type of an
277<<def_object,object>>.
Junio C Hamano1a4e8412005-12-27 08:17:23278
Junio C Hamano3d5b41f2007-03-26 02:33:41279[[def_octopus]]octopus::
Junio C Hamanoe3f080d2013-04-22 02:27:13280To <<def_merge,merge>> more than two <<def_branch,branches>>.
Junio C Hamano88a3a072006-05-04 08:01:43281
Junio C Hamano3d5b41f2007-03-26 02:33:41282[[def_origin]]origin::
283The default upstream <<def_repository,repository>>. Most projects have
284at least one upstream project which they track. By default
Junio C Hamano75485c82007-05-19 04:20:33285'origin' is used for that purpose. New upstream updates
Junio C Hamano8401f142013-07-12 22:47:46286will be fetched into <<def_remote_tracking_branch,remote-tracking branches>> named
Junio C Hamanod3361ad2007-01-01 03:20:24287origin/name-of-upstream-branch, which you can see using
Junio C Hamanoea82cff2009-03-18 01:54:48288`git branch -r`.
Junio C Hamano88a3a072006-05-04 08:01:43289
Junio C Hamano3d5b41f2007-03-26 02:33:41290[[def_pack]]pack::
291A set of objects which have been compressed into one file (to save space
292or to transmit them efficiently).
Junio C Hamano88a3a072006-05-04 08:01:43293
Junio C Hamano3d5b41f2007-03-26 02:33:41294[[def_pack_index]]pack index::
Junio C Hamano88a3a072006-05-04 08:01:43295The list of identifiers, and other information, of the objects in a
Junio C Hamano3d5b41f2007-03-26 02:33:41296<<def_pack,pack>>, to assist in efficiently accessing the contents of a
Junio C Hamano75485c82007-05-19 04:20:33297pack.
Junio C Hamano1a4e8412005-12-27 08:17:23298
Junio C Hamano63c2bc92011-02-28 06:41:28299[[def_pathspec]]pathspec::
Junio C Hamanoe3f080d2013-04-22 02:27:13300Pattern used to limit paths in Git commands.
Junio C Hamano63c2bc92011-02-28 06:41:28301+
302Pathspecs are used on the command line of "git ls-files", "git
Junio C Hamano2a294cd2011-05-23 23:06:31303ls-tree", "git add", "git grep", "git diff", "git checkout",
304and many other commands to
Junio C Hamano63c2bc92011-02-28 06:41:28305limit the scope of operations to some subset of the tree or
306worktree. See the documentation of each command for whether
307paths are relative to the current directory or toplevel. The
308pathspec syntax is as follows:
Junio C Hamanoe3f080d2013-04-22 02:27:13309+
310--
Junio C Hamano63c2bc92011-02-28 06:41:28311
312* any path matches itself
313* the pathspec up to the last slash represents a
314 directory prefix. The scope of that pathspec is
315 limited to that subtree.
316* the rest of the pathspec is a pattern for the remainder
317 of the pathname. Paths relative to the directory
318 prefix will be matched against that pattern using fnmatch(3);
319 in particular, '*' and '?' _can_ match directory separators.
Junio C Hamanoe3f080d2013-04-22 02:27:13320
321--
Junio C Hamano63c2bc92011-02-28 06:41:28322+
323For example, Documentation/*.jpg will match all .jpg files
324in the Documentation subtree,
325including Documentation/chapter_1/figure_1.jpg.
Junio C Hamano2a294cd2011-05-23 23:06:31326+
327A pathspec that begins with a colon `:` has special meaning. In the
328short form, the leading colon `:` is followed by zero or more "magic
329signature" letters (which optionally is terminated by another colon `:`),
Junio C Hamano21bc18b2014-01-10 20:33:07330and the remainder is the pattern to match against the path.
331The "magic signature" consists of ASCII symbols that are neither
Junio C Hamanofb5ffde2014-11-04 22:38:56332alphanumeric, glob, regex special characters nor colon.
Junio C Hamano21bc18b2014-01-10 20:33:07333The optional colon that terminates the "magic signature" can be
334omitted if the pattern begins with a character that does not belong to
335"magic signature" symbol set and is not a colon.
Junio C Hamano2a294cd2011-05-23 23:06:31336+
337In the long form, the leading colon `:` is followed by a open
338parenthesis `(`, a comma-separated list of zero or more "magic words",
339and a close parentheses `)`, and the remainder is the pattern to match
340against the path.
341+
Junio C Hamano21bc18b2014-01-10 20:33:07342A pathspec with only a colon means "there is no pathspec". This form
343should not be combined with other pathspec.
Junio C Hamano8eac2682013-09-09 22:35:20344+
345--
Junio C Hamano21bc18b2014-01-10 20:33:07346top;;
347The magic word `top` (magic signature: `/`) makes the pattern
348match from the root of the working tree, even when you are
349running the command from inside a subdirectory.
Junio C Hamano8eac2682013-09-09 22:35:20350
351literal;;
352Wildcards in the pattern such as `*` or `?` are treated
353as literal characters.
354
355icase;;
356Case insensitive match.
357
358glob;;
359Git treats the pattern as a shell glob suitable for
360consumption by fnmatch(3) with the FNM_PATHNAME flag:
361wildcards in the pattern will not match a / in the pathname.
362For example, "Documentation/{asterisk}.html" matches
363"Documentation/git.html" but not "Documentation/ppc/ppc.html"
364or "tools/perf/Documentation/perf.html".
365+
366Two consecutive asterisks ("`**`") in patterns matched against
367full pathname may have special meaning:
368
369 - A leading "`**`" followed by a slash means match in all
370 directories. For example, "`**/foo`" matches file or directory
Junio C Hamanob73af6c2013-12-03 22:07:11371 "`foo`" anywhere, the same as pattern "`foo`". "`**/foo/bar`"
Junio C Hamano8eac2682013-09-09 22:35:20372 matches file or directory "`bar`" anywhere that is directly
373 under directory "`foo`".
374
Junio C Hamanob73af6c2013-12-03 22:07:11375 - A trailing "`/**`" matches everything inside. For example,
376 "`abc/**`" matches all files inside directory "abc", relative
Junio C Hamano8eac2682013-09-09 22:35:20377 to the location of the `.gitignore` file, with infinite depth.
378
379 - A slash followed by two consecutive asterisks then a slash
380 matches zero or more directories. For example, "`a/**/b`"
381 matches "`a/b`", "`a/x/b`", "`a/x/y/b`" and so on.
382
383 - Other consecutive asterisks are considered invalid.
384+
385Glob magic is incompatible with literal magic.
Junio C Hamano21bc18b2014-01-10 20:33:07386
387exclude;;
388After a path matches any non-exclude pathspec, it will be run
389through all exclude pathspec (magic signature: `!`). If it
390matches, the path is ignored.
Junio C Hamano8eac2682013-09-09 22:35:20391--
Junio C Hamano2a294cd2011-05-23 23:06:31392
Junio C Hamano3d5b41f2007-03-26 02:33:41393[[def_parent]]parent::
394A <<def_commit_object,commit object>> contains a (possibly empty) list
395of the logical predecessor(s) in the line of development, i.e. its
396parents.
Junio C Hamano1a4e8412005-12-27 08:17:23397
Junio C Hamano3d5b41f2007-03-26 02:33:41398[[def_pickaxe]]pickaxe::
399The term <<def_pickaxe,pickaxe>> refers to an option to the diffcore
400routines that help select changes that add or delete a given text
Junio C Hamano764a6672007-10-23 01:23:31401string. With the `--pickaxe-all` option, it can be used to view the full
Junio C Hamano3d5b41f2007-03-26 02:33:41402<<def_changeset,changeset>> that introduced or removed, say, a
Junio C Hamano35738e82008-01-07 07:55:46403particular line of text. See linkgit:git-diff[1].
Junio C Hamano1a4e8412005-12-27 08:17:23404
Junio C Hamano3d5b41f2007-03-26 02:33:41405[[def_plumbing]]plumbing::
Junio C Hamano076ffcc2013-02-06 05:13:21406Cute name for <<def_core_git,core Git>>.
Junio C Hamano1a4e8412005-12-27 08:17:23407
Junio C Hamano3d5b41f2007-03-26 02:33:41408[[def_porcelain]]porcelain::
409Cute name for programs and program suites depending on
Junio C Hamano076ffcc2013-02-06 05:13:21410<<def_core_git,core Git>>, presenting a high level access to
411core Git. Porcelains expose more of a <<def_SCM,SCM>>
Junio C Hamano3d5b41f2007-03-26 02:33:41412interface than the <<def_plumbing,plumbing>>.
Junio C Hamano1a4e8412005-12-27 08:17:23413
Junio C Hamano37e467d2015-08-25 23:25:56414[[def_per_worktree_ref]]per-worktree ref::
415Refs that are per-<<def_working_tree,worktree>>, rather than
Junio C Hamano1eb56092015-10-05 20:39:53416global. This is presently only <<def_HEAD,HEAD>> and any refs
417that start with `refs/bisect/`, but might later include other
418unusual refs.
Junio C Hamano37e467d2015-08-25 23:25:56419
420[[def_pseudoref]]pseudoref::
421Pseudorefs are a class of files under `$GIT_DIR` which behave
422like refs for the purposes of rev-parse, but which are treated
423specially by git. Pseudorefs both have names that are all-caps,
424and always start with a line consisting of a
425<<def_SHA1,SHA-1>> followed by whitespace. So, HEAD is not a
426pseudoref, because it is sometimes a symbolic ref. They might
427optionally contain some additional data. `MERGE_HEAD` and
428`CHERRY_PICK_HEAD` are examples. Unlike
429<<def_per_worktree_ref,per-worktree refs>>, these files cannot
430be symbolic refs, and never have reflogs. They also cannot be
431updated through the normal ref update machinery. Instead,
432they are updated by directly writing to the files. However,
433they can be read as if they were refs, so `git rev-parse
434MERGE_HEAD` will work.
435
Junio C Hamano3d5b41f2007-03-26 02:33:41436[[def_pull]]pull::
437Pulling a <<def_branch,branch>> means to <<def_fetch,fetch>> it and
Junio C Hamano35738e82008-01-07 07:55:46438<<def_merge,merge>> it. See also linkgit:git-pull[1].
Junio C Hamano1a4e8412005-12-27 08:17:23439
Junio C Hamano3d5b41f2007-03-26 02:33:41440[[def_push]]push::
Junio C Hamano75485c82007-05-19 04:20:33441Pushing a <<def_branch,branch>> means to get the branch's
Junio C Hamano3d5b41f2007-03-26 02:33:41442<<def_head_ref,head ref>> from a remote <<def_repository,repository>>,
Junio C Hamano764a6672007-10-23 01:23:31443find out if it is a direct ancestor to the branch's local
444head ref, and in that case, putting all
Junio C Hamano3d5b41f2007-03-26 02:33:41445objects, which are <<def_reachable,reachable>> from the local
Junio C Hamano75485c82007-05-19 04:20:33446head ref, and which are missing from the remote
447repository, into the remote
Junio C Hamano3d5b41f2007-03-26 02:33:41448<<def_object_database,object database>>, and updating the remote
Junio C Hamano75485c82007-05-19 04:20:33449head ref. If the remote <<def_head,head>> is not an
450ancestor to the local head, the push fails.
Junio C Hamano1a4e8412005-12-27 08:17:23451
Junio C Hamano3d5b41f2007-03-26 02:33:41452[[def_reachable]]reachable::
453All of the ancestors of a given <<def_commit,commit>> are said to be
Junio C Hamano75485c82007-05-19 04:20:33454"reachable" from that commit. More
455generally, one <<def_object,object>> is reachable from
Junio C Hamano3d5b41f2007-03-26 02:33:41456another if we can reach the one from the other by a <<def_chain,chain>>
457that follows <<def_tag,tags>> to whatever they tag,
458<<def_commit_object,commits>> to their parents or trees, and
459<<def_tree_object,trees>> to the trees or <<def_blob_object,blobs>>
460that they contain.
Junio C Hamanof3e80c02006-01-11 00:54:55461
Junio C Hamano3d5b41f2007-03-26 02:33:41462[[def_rebase]]rebase::
463To reapply a series of changes from a <<def_branch,branch>> to a
464different base, and reset the <<def_head,head>> of that branch
465to the result.
Junio C Hamanof3e80c02006-01-11 00:54:55466
Junio C Hamano3d5b41f2007-03-26 02:33:41467[[def_ref]]ref::
Junio C Hamanoe6f28d02013-09-17 21:34:00468A name that begins with `refs/` (e.g. `refs/heads/master`)
469that points to an <<def_object_name,object name>> or another
470ref (the latter is called a <<def_symref,symbolic ref>>).
471For convenience, a ref can sometimes be abbreviated when used
472as an argument to a Git command; see linkgit:gitrevisions[7]
473for details.
474Refs are stored in the <<def_repository,repository>>.
475+
476The ref namespace is hierarchical.
477Different subhierarchies are used for different purposes (e.g. the
478`refs/heads/` hierarchy is used to represent local branches).
479+
480There are a few special-purpose refs that do not begin with `refs/`.
481The most notable example is `HEAD`.
Junio C Hamano1a4e8412005-12-27 08:17:23482
Junio C Hamanobb0f4042007-07-04 06:41:40483[[def_reflog]]reflog::
484A reflog shows the local "history" of a ref. In other words,
485it can tell you what the 3rd last revision in _this_ repository
486was, and what was the current state in _this_ repository,
Junio C Hamano35738e82008-01-07 07:55:46487yesterday 9:14pm. See linkgit:git-reflog[1] for details.
Junio C Hamanobb0f4042007-07-04 06:41:40488
Junio C Hamano3d5b41f2007-03-26 02:33:41489[[def_refspec]]refspec::
Junio C Hamano36460982007-05-27 04:29:12490A "refspec" is used by <<def_fetch,fetch>> and
Junio C Hamano75485c82007-05-19 04:20:33491<<def_push,push>> to describe the mapping between remote
Junio C Hamanoe3f080d2013-04-22 02:27:13492<<def_ref,ref>> and local ref.
Junio C Hamano88a3a072006-05-04 08:01:43493
Junio C Hamano8c5d5942015-06-11 19:37:48494[[def_remote]]remote repository::
495A <<def_repository,repository>> which is used to track the same
496project but resides somewhere else. To communicate with remotes,
497see <<def_fetch,fetch>> or <<def_push,push>>.
498
Junio C Hamano97bcb482010-11-25 03:16:07499[[def_remote_tracking_branch]]remote-tracking branch::
Junio C Hamanoc7102962013-05-29 23:57:17500A <<def_ref,ref>> that is used to follow changes from another
501<<def_repository,repository>>. It typically looks like
502'refs/remotes/foo/bar' (indicating that it tracks a branch named
503'bar' in a remote named 'foo'), and matches the right-hand-side of
504a configured fetch <<def_refspec,refspec>>. A remote-tracking
505branch should not contain direct modifications or have local
506commits made to it.
Junio C Hamano97bcb482010-11-25 03:16:07507
Junio C Hamano3d5b41f2007-03-26 02:33:41508[[def_repository]]repository::
Junio C Hamano36460982007-05-27 04:29:12509A collection of <<def_ref,refs>> together with an
Junio C Hamano75485c82007-05-19 04:20:33510<<def_object_database,object database>> containing all objects
511which are <<def_reachable,reachable>> from the refs, possibly
Junio C Hamano36460982007-05-27 04:29:12512accompanied by meta data from one or more <<def_porcelain,porcelains>>. A
513repository can share an object database with other repositories
514via <<def_alternate_object_database,alternates mechanism>>.
Junio C Hamano88a3a072006-05-04 08:01:43515
Junio C Hamano3d5b41f2007-03-26 02:33:41516[[def_resolve]]resolve::
517The action of fixing up manually what a failed automatic
518<<def_merge,merge>> left behind.
Junio C Hamano88a3a072006-05-04 08:01:43519
Junio C Hamano3d5b41f2007-03-26 02:33:41520[[def_revision]]revision::
Junio C Hamanof26c77e2013-04-27 00:06:04521Synonym for <<def_commit,commit>> (the noun).
Junio C Hamano88a3a072006-05-04 08:01:43522
Junio C Hamano3d5b41f2007-03-26 02:33:41523[[def_rewind]]rewind::
524To throw away part of the development, i.e. to assign the
525<<def_head,head>> to an earlier <<def_revision,revision>>.
Junio C Hamano88a3a072006-05-04 08:01:43526
Junio C Hamano3d5b41f2007-03-26 02:33:41527[[def_SCM]]SCM::
Junio C Hamano88a3a072006-05-04 08:01:43528Source code management (tool).
529
Junio C Hamanoe3f080d2013-04-22 02:27:13530[[def_SHA1]]SHA-1::
531"Secure Hash Algorithm 1"; a cryptographic hash function.
532In the context of Git used as a synonym for <<def_object_name,object name>>.
Junio C Hamano88a3a072006-05-04 08:01:43533
Junio C Hamano4e6ba272016-01-20 23:23:19534[[def_shallow_clone]]shallow clone::
535Mostly a synonym to <<def_shallow_repository,shallow repository>>
536but the phrase makes it more explicit that it was created by
537running `git clone --depth=...` command.
538
Junio C Hamano3d5b41f2007-03-26 02:33:41539[[def_shallow_repository]]shallow repository::
Junio C Hamano36460982007-05-27 04:29:12540A shallow <<def_repository,repository>> has an incomplete
541history some of whose <<def_commit,commits>> have <<def_parent,parents>> cauterized away (in other
Junio C Hamano076ffcc2013-02-06 05:13:21542words, Git is told to pretend that these commits do not have the
Junio C Hamano3d5b41f2007-03-26 02:33:41543parents, even though they are recorded in the <<def_commit_object,commit
544object>>). This is sometimes useful when you are interested only in the
545recent history of a project even though the real history recorded in the
Junio C Hamano75485c82007-05-19 04:20:33546upstream is much larger. A shallow repository
Junio C Hamano35738e82008-01-07 07:55:46547is created by giving the `--depth` option to linkgit:git-clone[1], and
548its history can be later deepened with linkgit:git-fetch[1].
Junio C Hamano4f9a6052007-01-17 20:25:16549
Junio C Hamano8c5d5942015-06-11 19:37:48550[[def_submodule]]submodule::
551A <<def_repository,repository>> that holds the history of a
552separate project inside another repository (the latter of
553which is called <<def_superproject, superproject>>).
554
555[[def_superproject]]superproject::
556A <<def_repository,repository>> that references repositories
557of other projects in its working tree as <<def_submodule,submodules>>.
558The superproject knows about the names of (but does not hold
559copies of) commit objects of the contained submodules.
560
Junio C Hamano3d5b41f2007-03-26 02:33:41561[[def_symref]]symref::
Junio C Hamanoe3f080d2013-04-22 02:27:13562Symbolic reference: instead of containing the <<def_SHA1,SHA-1>>
Junio C Hamano75485c82007-05-19 04:20:33563id itself, it is of the format 'ref: refs/some/thing' and when
564referenced, it recursively dereferences to this reference.
565'<<def_HEAD,HEAD>>' is a prime example of a symref. Symbolic
Junio C Hamano35738e82008-01-07 07:55:46566references are manipulated with the linkgit:git-symbolic-ref[1]
Junio C Hamano75485c82007-05-19 04:20:33567command.
Junio C Hamano3a971022006-11-18 22:17:58568
Junio C Hamano3d5b41f2007-03-26 02:33:41569[[def_tag]]tag::
Junio C Hamano360e3a12011-07-13 23:51:56570A <<def_ref,ref>> under `refs/tags/` namespace that points to an
571object of an arbitrary type (typically a tag points to either a
572<<def_tag_object,tag>> or a <<def_commit_object,commit object>>).
573In contrast to a <<def_head,head>>, a tag is not updated by
Junio C Hamano076ffcc2013-02-06 05:13:21574the `commit` command. A Git tag has nothing to do with a Lisp
Junio C Hamano360e3a12011-07-13 23:51:56575tag (which would be called an <<def_object_type,object type>>
Junio C Hamano076ffcc2013-02-06 05:13:21576in Git's context). A tag is most typically used to mark a particular
Junio C Hamano360e3a12011-07-13 23:51:56577point in the commit ancestry <<def_chain,chain>>.
Junio C Hamano88a3a072006-05-04 08:01:43578
Junio C Hamano3d5b41f2007-03-26 02:33:41579[[def_tag_object]]tag object::
580An <<def_object,object>> containing a <<def_ref,ref>> pointing to
Junio C Hamano75485c82007-05-19 04:20:33581another object, which can contain a message just like a
Junio C Hamano3d5b41f2007-03-26 02:33:41582<<def_commit_object,commit object>>. It can also contain a (PGP)
Junio C Hamano36460982007-05-27 04:29:12583signature, in which case it is called a "signed tag object".
Junio C Hamano88a3a072006-05-04 08:01:43584
Junio C Hamano3d5b41f2007-03-26 02:33:41585[[def_topic_branch]]topic branch::
Junio C Hamano076ffcc2013-02-06 05:13:21586A regular Git <<def_branch,branch>> that is used by a developer to
Junio C Hamano3d5b41f2007-03-26 02:33:41587identify a conceptual line of development. Since branches are very easy
588and inexpensive, it is often desirable to have several small branches
589that each contain very well defined concepts or small incremental yet
590related changes.
Junio C Hamano88a3a072006-05-04 08:01:43591
Junio C Hamano3d5b41f2007-03-26 02:33:41592[[def_tree]]tree::
593Either a <<def_working_tree,working tree>>, or a <<def_tree_object,tree
Junio C Hamano36460982007-05-27 04:29:12594object>> together with the dependent <<def_blob_object,blob>> and tree objects
Junio C Hamano75485c82007-05-19 04:20:33595(i.e. a stored representation of a working tree).
Junio C Hamano1a4e8412005-12-27 08:17:23596
Junio C Hamano3d5b41f2007-03-26 02:33:41597[[def_tree_object]]tree object::
598An <<def_object,object>> containing a list of file names and modes along
599with refs to the associated blob and/or tree objects. A
600<<def_tree,tree>> is equivalent to a <<def_directory,directory>>.
Junio C Hamano1a4e8412005-12-27 08:17:23601
Junio C Hamanoe6f28d02013-09-17 21:34:00602[[def_tree-ish]]tree-ish (also treeish)::
603A <<def_tree_object,tree object>> or an <<def_object,object>>
604that can be recursively dereferenced to a tree object.
605Dereferencing a <<def_commit_object,commit object>> yields the
606tree object corresponding to the <<def_revision,revision>>'s
607top <<def_directory,directory>>.
608The following are all tree-ishes:
609a <<def_commit-ish,commit-ish>>,
610a tree object,
611a <<def_tag_object,tag object>> that points to a tree object,
612a tag object that points to a tag object that points to a tree
613object,
614etc.
Junio C Hamano1a4e8412005-12-27 08:17:23615
Junio C Hamano3d5b41f2007-03-26 02:33:41616[[def_unmerged_index]]unmerged index::
617An <<def_index,index>> which contains unmerged
618<<def_index_entry,index entries>>.
Junio C Hamano1a4e8412005-12-27 08:17:23619
Junio C Hamano3d5b41f2007-03-26 02:33:41620[[def_unreachable_object]]unreachable object::
621An <<def_object,object>> which is not <<def_reachable,reachable>> from a
622<<def_branch,branch>>, <<def_tag,tag>>, or any other reference.
Junio C Hamanoaa83a7d2007-03-05 02:37:29623
Junio C Hamano98e32c32009-04-13 02:39:53624[[def_upstream_branch]]upstream branch::
625The default <<def_branch,branch>> that is merged into the branch in
626question (or the branch in question is rebased onto). It is configured
627via branch.<name>.remote and branch.<name>.merge. If the upstream branch
628of 'A' is 'origin/B' sometimes we say "'A' is tracking 'origin/B'".
629
Junio C Hamano3d5b41f2007-03-26 02:33:41630[[def_working_tree]]working tree::
Junio C Hamanoc0e55e72009-10-10 00:56:29631The tree of actual checked out files. The working tree normally
632contains the contents of the <<def_HEAD,HEAD>> commit's tree,
633plus any local changes that you have made but not yet committed.