blob: 5a537268e275e45142640820942004b5cd731dbb [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 Hamano441dc8c2020-12-14 19:18:3221A "branch" is a line of development. The most recent
Junio C Hamano75485c82007-05-19 04:20:3322<<def_commit,commit>> on a branch is referred to as the tip of
Junio C Hamanoe8c74d82022-11-12 07:59:3623that branch. The tip of the branch is <<def_ref,referenced>> by a branch
Junio C Hamano75485c82007-05-19 04:20:3324<<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 Hamanoe8c74d82022-11-12 07:59:3678[[def_commit_graph_general]]commit graph concept, representations and usage::
79A synonym for the <<def_DAG,DAG>> structure formed by the commits
80in the object database, <<def_ref,referenced>> by branch tips,
81using their <<def_chain,chain>> of linked commits.
82This structure is the definitive commit graph. The
83graph can be represented in other ways, e.g. the
84<<def_commit_graph_file,"commit-graph" file>>.
85
86[[def_commit_graph_file]]commit-graph file::
87The "commit-graph" (normally hyphenated) file is a supplemental
88representation of the <<def_commit_graph_general,commit graph>>
89which accelerates commit graph walks. The "commit-graph" file is
90stored either in the .git/objects/info directory or in the info
91directory of an alternate object database.
92
Junio C Hamano3d5b41f2007-03-26 02:33:4193[[def_commit_object]]commit object::
94An <<def_object,object>> which contains the information about a
Junio C Hamano36460982007-05-27 04:29:1295particular <<def_revision,revision>>, such as <<def_parent,parents>>, committer,
Junio C Hamano3d5b41f2007-03-26 02:33:4196author, date and the <<def_tree_object,tree object>> which corresponds
97to the top <<def_directory,directory>> of the stored
Junio C Hamano36460982007-05-27 04:29:1298revision.
Junio C Hamano1a4e8412005-12-27 08:17:2399
Junio C Hamanoe6f28d02013-09-17 21:34:00100[[def_commit-ish]]commit-ish (also committish)::
101A <<def_commit_object,commit object>> or an
102<<def_object,object>> that can be recursively dereferenced to
103a commit object.
104The following are all commit-ishes:
105a commit object,
106a <<def_tag_object,tag object>> that points to a commit
107object,
108a tag object that points to a tag object that points to a
109commit object,
110etc.
111
Junio C Hamano076ffcc2013-02-06 05:13:21112[[def_core_git]]core Git::
113Fundamental data structures and utilities of Git. Exposes only limited
Junio C Hamano3d5b41f2007-03-26 02:33:41114source code management tools.
Junio C Hamano1a4e8412005-12-27 08:17:23115
Junio C Hamano3d5b41f2007-03-26 02:33:41116[[def_DAG]]DAG::
Junio C Hamano9e1793f2008-06-02 07:31:16117Directed acyclic graph. The <<def_commit_object,commit objects>> form a
Junio C Hamano3d5b41f2007-03-26 02:33:41118directed acyclic graph, because they have parents (directed), and the
Junio C Hamano9e1793f2008-06-02 07:31:16119graph of commit objects is acyclic (there is no <<def_chain,chain>>
120which begins and ends with the same <<def_object,object>>).
Junio C Hamanoaa83a7d2007-03-05 02:37:29121
Junio C Hamano3d5b41f2007-03-26 02:33:41122[[def_dangling_object]]dangling object::
123An <<def_unreachable_object,unreachable object>> which is not
124<<def_reachable,reachable>> even from other unreachable objects; a
Junio C Hamano75485c82007-05-19 04:20:33125dangling object has no references to it from any
Junio C Hamano3d5b41f2007-03-26 02:33:41126reference or <<def_object,object>> in the <<def_repository,repository>>.
127
Junio C Hamano75485c82007-05-19 04:20:33128[[def_detached_HEAD]]detached HEAD::
129Normally the <<def_HEAD,HEAD>> stores the name of a
Junio C Hamanoea3b7522013-04-18 19:37:53130<<def_branch,branch>>, and commands that operate on the
131history HEAD represents operate on the history leading to the
132tip of the branch the HEAD points at. However, Git also
133allows you to <<def_checkout,check out>> an arbitrary
134<<def_commit,commit>> that isn't necessarily the tip of any
135particular branch. The HEAD in such a state is called
136"detached".
137+
138Note that commands that operate on the history of the current branch
139(e.g. `git commit` to build a new history on top of it) still work
140while the HEAD is detached. They update the HEAD to point at the tip
141of the updated history without affecting any branch. Commands that
142update or inquire information _about_ the current branch (e.g. `git
Junio C Hamano8401f142013-07-12 22:47:46143branch --set-upstream-to` that sets what remote-tracking branch the
Junio C Hamanoea3b7522013-04-18 19:37:53144current branch integrates with) obviously do not work, as there is no
145(real) current branch to ask about in this state.
Junio C Hamano75485c82007-05-19 04:20:33146
Junio C Hamano3d5b41f2007-03-26 02:33:41147[[def_directory]]directory::
Junio C Hamano88a3a072006-05-04 08:01:43148The list you get with "ls" :-)
149
Junio C Hamano3d5b41f2007-03-26 02:33:41150[[def_dirty]]dirty::
Junio C Hamano75485c82007-05-19 04:20:33151A <<def_working_tree,working tree>> is said to be "dirty" if
Junio C Hamano36460982007-05-27 04:29:12152it contains modifications which have not been <<def_commit,committed>> to the current
Junio C Hamano3d5b41f2007-03-26 02:33:41153<<def_branch,branch>>.
154
Junio C Hamano36460982007-05-27 04:29:12155[[def_evil_merge]]evil merge::
156An evil merge is a <<def_merge,merge>> that introduces changes that
157do not appear in any <<def_parent,parent>>.
158
Junio C Hamano3f680f32009-11-16 02:10:54159[[def_fast_forward]]fast-forward::
Junio C Hamano3d5b41f2007-03-26 02:33:41160A fast-forward is a special type of <<def_merge,merge>> where you have a
161<<def_revision,revision>> and you are "merging" another
162<<def_branch,branch>>'s changes that happen to be a descendant of what
Junio C Hamano74fd0fc2016-05-10 21:23:56163you have. In such a case, you do not make a new <<def_merge,merge>>
Junio C Hamano37c77fd2021-06-10 03:53:56164<<def_commit,commit>> but instead just update your branch to point at the same
165revision as the branch you are merging. This will happen frequently on a
Junio C Hamano97bcb482010-11-25 03:16:07166<<def_remote_tracking_branch,remote-tracking branch>> of a remote
Junio C Hamano3d5b41f2007-03-26 02:33:41167<<def_repository,repository>>.
Junio C Hamano88a3a072006-05-04 08:01:43168
Junio C Hamano3d5b41f2007-03-26 02:33:41169[[def_fetch]]fetch::
170Fetching a <<def_branch,branch>> means to get the
Junio C Hamano75485c82007-05-19 04:20:33171branch's <<def_head_ref,head ref>> from a remote
172<<def_repository,repository>>, to find out which objects are
173missing from the local <<def_object_database,object database>>,
Junio C Hamano35738e82008-01-07 07:55:46174and to get them, too. See also linkgit:git-fetch[1].
Junio C Hamano88a3a072006-05-04 08:01:43175
Junio C Hamano3d5b41f2007-03-26 02:33:41176[[def_file_system]]file system::
Junio C Hamano076ffcc2013-02-06 05:13:21177Linus Torvalds originally designed Git to be a user space file system,
Junio C Hamano3d5b41f2007-03-26 02:33:41178i.e. the infrastructure to hold files and directories. That ensured the
Junio C Hamano076ffcc2013-02-06 05:13:21179efficiency and speed of Git.
Junio C Hamano88a3a072006-05-04 08:01:43180
Junio C Hamano076ffcc2013-02-06 05:13:21181[[def_git_archive]]Git archive::
Junio C Hamano3d5b41f2007-03-26 02:33:41182Synonym for <<def_repository,repository>> (for arch people).
Junio C Hamano88a3a072006-05-04 08:01:43183
Junio C Hamano076ffcc2013-02-06 05:13:21184[[def_gitfile]]gitfile::
185A plain file `.git` at the root of a working tree that
186points at the directory that is the real repository.
187
Junio C Hamano3d5b41f2007-03-26 02:33:41188[[def_grafts]]grafts::
189Grafts enables two otherwise different lines of development to be joined
190together by recording fake ancestry information for commits. This way
Junio C Hamano076ffcc2013-02-06 05:13:21191you can make Git pretend the set of <<def_parent,parents>> a <<def_commit,commit>> has
Junio C Hamano75485c82007-05-19 04:20:33192is different from what was recorded when the commit was
Junio C Hamano3d5b41f2007-03-26 02:33:41193created. Configured via the `.git/info/grafts` file.
Junio C Hamano3b0cdc22014-03-18 22:06:16194+
195Note that the grafts mechanism is outdated and can lead to problems
196transferring objects between repositories; see linkgit:git-replace[1]
197for a more flexible and robust system to do the same thing.
Junio C Hamano33db4372006-06-07 19:51:45198
Junio C Hamano3d5b41f2007-03-26 02:33:41199[[def_hash]]hash::
Junio C Hamanoe3f080d2013-04-22 02:27:13200In Git's context, synonym for <<def_object_name,object name>>.
Junio C Hamano88a3a072006-05-04 08:01:43201
Junio C Hamano3d5b41f2007-03-26 02:33:41202[[def_head]]head::
Junio C Hamano36460982007-05-27 04:29:12203A <<def_ref,named reference>> to the <<def_commit,commit>> at the tip of a
Junio C Hamano360e3a12011-07-13 23:51:56204<<def_branch,branch>>. Heads are stored in a file in
205`$GIT_DIR/refs/heads/` directory, except when using packed refs. (See
Junio C Hamano35738e82008-01-07 07:55:46206linkgit:git-pack-refs[1].)
Junio C Hamano75485c82007-05-19 04:20:33207
208[[def_HEAD]]HEAD::
Junio C Hamano36460982007-05-27 04:29:12209The current <<def_branch,branch>>. In more detail: Your <<def_working_tree,
Junio C Hamano75485c82007-05-19 04:20:33210working tree>> is normally derived from the state of the tree
211referred to by HEAD. HEAD is a reference to one of the
212<<def_head,heads>> in your repository, except when using a
Junio C Hamano360e3a12011-07-13 23:51:56213<<def_detached_HEAD,detached HEAD>>, in which case it directly
214references an arbitrary commit.
Junio C Hamano88a3a072006-05-04 08:01:43215
Junio C Hamano3d5b41f2007-03-26 02:33:41216[[def_head_ref]]head ref::
Junio C Hamano75485c82007-05-19 04:20:33217A synonym for <<def_head,head>>.
Junio C Hamano88a3a072006-05-04 08:01:43218
Junio C Hamano3d5b41f2007-03-26 02:33:41219[[def_hook]]hook::
Junio C Hamano076ffcc2013-02-06 05:13:21220During the normal execution of several Git commands, call-outs are made
Junio C Hamano3d5b41f2007-03-26 02:33:41221to optional scripts that allow a developer to add functionality or
222checking. Typically, the hooks allow for a command to be pre-verified
223and potentially aborted, and allow for a post-notification after the
Junio C Hamano75485c82007-05-19 04:20:33224operation is done. The hook scripts are found in the
Junio C Hamano36460982007-05-27 04:29:12225`$GIT_DIR/hooks/` directory, and are enabled by simply
Junio C Hamano116db352008-12-17 19:48:40226removing the `.sample` suffix from the filename. In earlier versions
Junio C Hamano076ffcc2013-02-06 05:13:21227of Git you had to make them executable.
Junio C Hamano88a3a072006-05-04 08:01:43228
Junio C Hamano3d5b41f2007-03-26 02:33:41229[[def_index]]index::
230A collection of files with stat information, whose contents are stored
Junio C Hamano36460982007-05-27 04:29:12231as objects. The index is a stored version of your
232<<def_working_tree,working tree>>. Truth be told, it can also contain a second, and even
233a third version of a working tree, which are used
234when <<def_merge,merging>>.
Junio C Hamano1a4e8412005-12-27 08:17:23235
Junio C Hamano3d5b41f2007-03-26 02:33:41236[[def_index_entry]]index entry::
237The information regarding a particular file, stored in the
Junio C Hamano75485c82007-05-19 04:20:33238<<def_index,index>>. An index entry can be unmerged, if a
239<<def_merge,merge>> was started, but not yet finished (i.e. if
240the index contains multiple versions of that file).
Junio C Hamano1a4e8412005-12-27 08:17:23241
Junio C Hamano3d5b41f2007-03-26 02:33:41242[[def_master]]master::
Junio C Hamano75485c82007-05-19 04:20:33243The default development <<def_branch,branch>>. Whenever you
Junio C Hamano076ffcc2013-02-06 05:13:21244create a Git <<def_repository,repository>>, a branch named
Junio C Hamano75485c82007-05-19 04:20:33245"master" is created, and becomes the active branch. In most
246cases, this contains the local development, though that is
247purely by convention and is not required.
Junio C Hamano1a4e8412005-12-27 08:17:23248
Junio C Hamano3d5b41f2007-03-26 02:33:41249[[def_merge]]merge::
Junio C Hamano75485c82007-05-19 04:20:33250As a verb: To bring the contents of another
251<<def_branch,branch>> (possibly from an external
252<<def_repository,repository>>) into the current branch. In the
253case where the merged-in branch is from a different repository,
254this is done by first <<def_fetch,fetching>> the remote branch
255and then merging the result into the current branch. This
256combination of fetch and merge operations is called a
257<<def_pull,pull>>. Merging is performed by an automatic process
258that identifies changes made since the branches diverged, and
259then applies all those changes together. In cases where changes
260conflict, manual intervention may be required to complete the
261merge.
262+
Junio C Hamano3f680f32009-11-16 02:10:54263As a noun: unless it is a <<def_fast_forward,fast-forward>>, a
Junio C Hamano75485c82007-05-19 04:20:33264successful merge results in the creation of a new <<def_commit,commit>>
265representing the result of the merge, and having as
266<<def_parent,parents>> the tips of the merged <<def_branch,branches>>.
267This commit is referred to as a "merge commit", or sometimes just a
268"merge".
Junio C Hamano1a4e8412005-12-27 08:17:23269
Junio C Hamano3d5b41f2007-03-26 02:33:41270[[def_object]]object::
Junio C Hamano076ffcc2013-02-06 05:13:21271The unit of storage in Git. It is uniquely identified by the
Junio C Hamanoe3f080d2013-04-22 02:27:13272<<def_SHA1,SHA-1>> of its contents. Consequently, an
Junio C Hamano2aba1012019-08-08 21:46:11273object cannot be changed.
Junio C Hamano1a4e8412005-12-27 08:17:23274
Junio C Hamano3d5b41f2007-03-26 02:33:41275[[def_object_database]]object database::
276Stores a set of "objects", and an individual <<def_object,object>> is
277identified by its <<def_object_name,object name>>. The objects usually
278live in `$GIT_DIR/objects/`.
Junio C Hamano1a4e8412005-12-27 08:17:23279
Junio C Hamanoe8c74d82022-11-12 07:59:36280[[def_object_identifier]]object identifier (oid)::
Junio C Hamano3d5b41f2007-03-26 02:33:41281Synonym for <<def_object_name,object name>>.
Junio C Hamano1a4e8412005-12-27 08:17:23282
Junio C Hamano3d5b41f2007-03-26 02:33:41283[[def_object_name]]object name::
Junio C Hamanoe3f080d2013-04-22 02:27:13284The unique identifier of an <<def_object,object>>. The
285object name is usually represented by a 40 character
286hexadecimal string. Also colloquially called <<def_SHA1,SHA-1>>.
Junio C Hamano1a4e8412005-12-27 08:17:23287
Junio C Hamano3d5b41f2007-03-26 02:33:41288[[def_object_type]]object type::
Junio C Hamano9e1793f2008-06-02 07:31:16289One of the identifiers "<<def_commit_object,commit>>",
290"<<def_tree_object,tree>>", "<<def_tag_object,tag>>" or
291"<<def_blob_object,blob>>" describing the type of an
292<<def_object,object>>.
Junio C Hamano1a4e8412005-12-27 08:17:23293
Junio C Hamano3d5b41f2007-03-26 02:33:41294[[def_octopus]]octopus::
Junio C Hamanoe3f080d2013-04-22 02:27:13295To <<def_merge,merge>> more than two <<def_branch,branches>>.
Junio C Hamano88a3a072006-05-04 08:01:43296
Junio C Hamano3d5b41f2007-03-26 02:33:41297[[def_origin]]origin::
298The default upstream <<def_repository,repository>>. Most projects have
299at least one upstream project which they track. By default
Junio C Hamano75485c82007-05-19 04:20:33300'origin' is used for that purpose. New upstream updates
Junio C Hamano8401f142013-07-12 22:47:46301will be fetched into <<def_remote_tracking_branch,remote-tracking branches>> named
Junio C Hamanod3361ad2007-01-01 03:20:24302origin/name-of-upstream-branch, which you can see using
Junio C Hamanoea82cff2009-03-18 01:54:48303`git branch -r`.
Junio C Hamano88a3a072006-05-04 08:01:43304
Junio C Hamano6b7d2152019-04-16 12:51:15305[[def_overlay]]overlay::
306Only update and add files to the working directory, but don't
307delete them, similar to how 'cp -R' would update the contents
308in the destination directory. This is the default mode in a
309<<def_checkout,checkout>> when checking out files from the
310<<def_index,index>> or a <<def_tree-ish,tree-ish>>. In
311contrast, no-overlay mode also deletes tracked files not
312present in the source, similar to 'rsync --delete'.
313
Junio C Hamano3d5b41f2007-03-26 02:33:41314[[def_pack]]pack::
315A set of objects which have been compressed into one file (to save space
316or to transmit them efficiently).
Junio C Hamano88a3a072006-05-04 08:01:43317
Junio C Hamano3d5b41f2007-03-26 02:33:41318[[def_pack_index]]pack index::
Junio C Hamano88a3a072006-05-04 08:01:43319The list of identifiers, and other information, of the objects in a
Junio C Hamano3d5b41f2007-03-26 02:33:41320<<def_pack,pack>>, to assist in efficiently accessing the contents of a
Junio C Hamano75485c82007-05-19 04:20:33321pack.
Junio C Hamano1a4e8412005-12-27 08:17:23322
Junio C Hamano63c2bc92011-02-28 06:41:28323[[def_pathspec]]pathspec::
Junio C Hamanoe3f080d2013-04-22 02:27:13324Pattern used to limit paths in Git commands.
Junio C Hamano63c2bc92011-02-28 06:41:28325+
326Pathspecs are used on the command line of "git ls-files", "git
Junio C Hamano2a294cd2011-05-23 23:06:31327ls-tree", "git add", "git grep", "git diff", "git checkout",
328and many other commands to
Junio C Hamano63c2bc92011-02-28 06:41:28329limit the scope of operations to some subset of the tree or
Junio C Hamano99a21c32022-02-18 22:08:41330working tree. See the documentation of each command for whether
Junio C Hamano63c2bc92011-02-28 06:41:28331paths are relative to the current directory or toplevel. The
332pathspec syntax is as follows:
Junio C Hamanoe3f080d2013-04-22 02:27:13333+
334--
Junio C Hamano63c2bc92011-02-28 06:41:28335
336* any path matches itself
337* the pathspec up to the last slash represents a
338 directory prefix. The scope of that pathspec is
339 limited to that subtree.
340* the rest of the pathspec is a pattern for the remainder
341 of the pathname. Paths relative to the directory
342 prefix will be matched against that pattern using fnmatch(3);
343 in particular, '*' and '?' _can_ match directory separators.
Junio C Hamanoe3f080d2013-04-22 02:27:13344
345--
Junio C Hamano63c2bc92011-02-28 06:41:28346+
347For example, Documentation/*.jpg will match all .jpg files
348in the Documentation subtree,
349including Documentation/chapter_1/figure_1.jpg.
Junio C Hamano2a294cd2011-05-23 23:06:31350+
351A pathspec that begins with a colon `:` has special meaning. In the
352short form, the leading colon `:` is followed by zero or more "magic
353signature" letters (which optionally is terminated by another colon `:`),
Junio C Hamano21bc18b2014-01-10 20:33:07354and the remainder is the pattern to match against the path.
355The "magic signature" consists of ASCII symbols that are neither
Junio C Hamanofb5ffde2014-11-04 22:38:56356alphanumeric, glob, regex special characters nor colon.
Junio C Hamano21bc18b2014-01-10 20:33:07357The optional colon that terminates the "magic signature" can be
358omitted if the pattern begins with a character that does not belong to
359"magic signature" symbol set and is not a colon.
Junio C Hamano2a294cd2011-05-23 23:06:31360+
Junio C Hamanoea1ac8d2018-07-18 20:16:48361In the long form, the leading colon `:` is followed by an open
Junio C Hamano2a294cd2011-05-23 23:06:31362parenthesis `(`, a comma-separated list of zero or more "magic words",
363and a close parentheses `)`, and the remainder is the pattern to match
364against the path.
365+
Junio C Hamano21bc18b2014-01-10 20:33:07366A pathspec with only a colon means "there is no pathspec". This form
367should not be combined with other pathspec.
Junio C Hamano8eac2682013-09-09 22:35:20368+
369--
Junio C Hamano21bc18b2014-01-10 20:33:07370top;;
371The magic word `top` (magic signature: `/`) makes the pattern
372match from the root of the working tree, even when you are
373running the command from inside a subdirectory.
Junio C Hamano8eac2682013-09-09 22:35:20374
375literal;;
376Wildcards in the pattern such as `*` or `?` are treated
377as literal characters.
378
379icase;;
380Case insensitive match.
381
382glob;;
383Git treats the pattern as a shell glob suitable for
384consumption by fnmatch(3) with the FNM_PATHNAME flag:
385wildcards in the pattern will not match a / in the pathname.
386For example, "Documentation/{asterisk}.html" matches
387"Documentation/git.html" but not "Documentation/ppc/ppc.html"
388or "tools/perf/Documentation/perf.html".
389+
390Two consecutive asterisks ("`**`") in patterns matched against
391full pathname may have special meaning:
392
393 - A leading "`**`" followed by a slash means match in all
394 directories. For example, "`**/foo`" matches file or directory
Junio C Hamanob73af6c2013-12-03 22:07:11395 "`foo`" anywhere, the same as pattern "`foo`". "`**/foo/bar`"
Junio C Hamano8eac2682013-09-09 22:35:20396 matches file or directory "`bar`" anywhere that is directly
397 under directory "`foo`".
398
Junio C Hamanob73af6c2013-12-03 22:07:11399 - A trailing "`/**`" matches everything inside. For example,
400 "`abc/**`" matches all files inside directory "abc", relative
Junio C Hamano8eac2682013-09-09 22:35:20401 to the location of the `.gitignore` file, with infinite depth.
402
403 - A slash followed by two consecutive asterisks then a slash
404 matches zero or more directories. For example, "`a/**/b`"
405 matches "`a/b`", "`a/x/b`", "`a/x/y/b`" and so on.
406
407 - Other consecutive asterisks are considered invalid.
408+
409Glob magic is incompatible with literal magic.
Junio C Hamano21bc18b2014-01-10 20:33:07410
Junio C Hamano3d4a66d2017-03-17 21:07:26411attr;;
412After `attr:` comes a space separated list of "attribute
413requirements", all of which must be met in order for the
414path to be considered a match; this is in addition to the
415usual non-magic pathspec pattern matching.
416See linkgit:gitattributes[5].
417+
418Each of the attribute requirements for the path takes one of
419these forms:
420
421- "`ATTR`" requires that the attribute `ATTR` be set.
422
423- "`-ATTR`" requires that the attribute `ATTR` be unset.
424
425- "`ATTR=VALUE`" requires that the attribute `ATTR` be
426 set to the string `VALUE`.
427
428- "`!ATTR`" requires that the attribute `ATTR` be
429 unspecified.
430+
Junio C Hamanoace33e42019-01-18 23:16:05431Note that when matching against a tree object, attributes are still
432obtained from working tree, not from the given tree object.
Junio C Hamano3d4a66d2017-03-17 21:07:26433
Junio C Hamano21bc18b2014-01-10 20:33:07434exclude;;
435After a path matches any non-exclude pathspec, it will be run
Junio C Hamano139b7d12017-10-03 07:10:59436through all exclude pathspecs (magic signature: `!` or its
Junio C Hamanocbe0eb22017-02-27 23:37:49437synonym `^`). If it matches, the path is ignored. When there
438is no non-exclude pathspec, the exclusion is applied to the
439result set as if invoked without any pathspec.
Junio C Hamano8eac2682013-09-09 22:35:20440--
Junio C Hamano2a294cd2011-05-23 23:06:31441
Junio C Hamano3d5b41f2007-03-26 02:33:41442[[def_parent]]parent::
443A <<def_commit_object,commit object>> contains a (possibly empty) list
444of the logical predecessor(s) in the line of development, i.e. its
445parents.
Junio C Hamano1a4e8412005-12-27 08:17:23446
Junio C Hamano3d5b41f2007-03-26 02:33:41447[[def_pickaxe]]pickaxe::
448The term <<def_pickaxe,pickaxe>> refers to an option to the diffcore
449routines that help select changes that add or delete a given text
Junio C Hamano764a6672007-10-23 01:23:31450string. With the `--pickaxe-all` option, it can be used to view the full
Junio C Hamano3d5b41f2007-03-26 02:33:41451<<def_changeset,changeset>> that introduced or removed, say, a
Junio C Hamano35738e82008-01-07 07:55:46452particular line of text. See linkgit:git-diff[1].
Junio C Hamano1a4e8412005-12-27 08:17:23453
Junio C Hamano3d5b41f2007-03-26 02:33:41454[[def_plumbing]]plumbing::
Junio C Hamano076ffcc2013-02-06 05:13:21455Cute name for <<def_core_git,core Git>>.
Junio C Hamano1a4e8412005-12-27 08:17:23456
Junio C Hamano3d5b41f2007-03-26 02:33:41457[[def_porcelain]]porcelain::
458Cute name for programs and program suites depending on
Junio C Hamano076ffcc2013-02-06 05:13:21459<<def_core_git,core Git>>, presenting a high level access to
460core Git. Porcelains expose more of a <<def_SCM,SCM>>
Junio C Hamano3d5b41f2007-03-26 02:33:41461interface than the <<def_plumbing,plumbing>>.
Junio C Hamano1a4e8412005-12-27 08:17:23462
Junio C Hamano37e467d2015-08-25 23:25:56463[[def_per_worktree_ref]]per-worktree ref::
Junio C Hamano99a21c32022-02-18 22:08:41464Refs that are per-<<def_worktree,worktree>>, rather than
Junio C Hamano1eb56092015-10-05 20:39:53465global. This is presently only <<def_HEAD,HEAD>> and any refs
466that start with `refs/bisect/`, but might later include other
467unusual refs.
Junio C Hamano37e467d2015-08-25 23:25:56468
469[[def_pseudoref]]pseudoref::
470Pseudorefs are a class of files under `$GIT_DIR` which behave
471like refs for the purposes of rev-parse, but which are treated
472specially by git. Pseudorefs both have names that are all-caps,
473and always start with a line consisting of a
474<<def_SHA1,SHA-1>> followed by whitespace. So, HEAD is not a
475pseudoref, because it is sometimes a symbolic ref. They might
476optionally contain some additional data. `MERGE_HEAD` and
477`CHERRY_PICK_HEAD` are examples. Unlike
478<<def_per_worktree_ref,per-worktree refs>>, these files cannot
479be symbolic refs, and never have reflogs. They also cannot be
480updated through the normal ref update machinery. Instead,
481they are updated by directly writing to the files. However,
482they can be read as if they were refs, so `git rev-parse
483MERGE_HEAD` will work.
484
Junio C Hamano3d5b41f2007-03-26 02:33:41485[[def_pull]]pull::
486Pulling a <<def_branch,branch>> means to <<def_fetch,fetch>> it and
Junio C Hamano35738e82008-01-07 07:55:46487<<def_merge,merge>> it. See also linkgit:git-pull[1].
Junio C Hamano1a4e8412005-12-27 08:17:23488
Junio C Hamano3d5b41f2007-03-26 02:33:41489[[def_push]]push::
Junio C Hamano75485c82007-05-19 04:20:33490Pushing a <<def_branch,branch>> means to get the branch's
Junio C Hamano3d5b41f2007-03-26 02:33:41491<<def_head_ref,head ref>> from a remote <<def_repository,repository>>,
Junio C Hamanoccb82522018-05-08 07:52:09492find out if it is an ancestor to the branch's local
Junio C Hamano764a6672007-10-23 01:23:31493head ref, and in that case, putting all
Junio C Hamano3d5b41f2007-03-26 02:33:41494objects, which are <<def_reachable,reachable>> from the local
Junio C Hamano75485c82007-05-19 04:20:33495head ref, and which are missing from the remote
496repository, into the remote
Junio C Hamano3d5b41f2007-03-26 02:33:41497<<def_object_database,object database>>, and updating the remote
Junio C Hamano75485c82007-05-19 04:20:33498head ref. If the remote <<def_head,head>> is not an
499ancestor to the local head, the push fails.
Junio C Hamano1a4e8412005-12-27 08:17:23500
Junio C Hamano3d5b41f2007-03-26 02:33:41501[[def_reachable]]reachable::
502All of the ancestors of a given <<def_commit,commit>> are said to be
Junio C Hamano75485c82007-05-19 04:20:33503"reachable" from that commit. More
504generally, one <<def_object,object>> is reachable from
Junio C Hamano3d5b41f2007-03-26 02:33:41505another if we can reach the one from the other by a <<def_chain,chain>>
506that follows <<def_tag,tags>> to whatever they tag,
507<<def_commit_object,commits>> to their parents or trees, and
508<<def_tree_object,trees>> to the trees or <<def_blob_object,blobs>>
509that they contain.
Junio C Hamanof3e80c02006-01-11 00:54:55510
Junio C Hamanoe8c74d82022-11-12 07:59:36511[[def_reachability_bitmap]]reachability bitmaps::
512Reachability bitmaps store information about the
513<<def_reachable,reachability>> of a selected set of commits in
514a packfile, or a multi-pack index (MIDX), to speed up object search.
515The bitmaps are stored in a ".bitmap" file. A repository may have at
516most one bitmap file in use. The bitmap file may belong to either one
517pack, or the repository's multi-pack index (if it exists).
518
Junio C Hamano3d5b41f2007-03-26 02:33:41519[[def_rebase]]rebase::
520To reapply a series of changes from a <<def_branch,branch>> to a
521different base, and reset the <<def_head,head>> of that branch
522to the result.
Junio C Hamanof3e80c02006-01-11 00:54:55523
Junio C Hamano3d5b41f2007-03-26 02:33:41524[[def_ref]]ref::
Junio C Hamanoe6f28d02013-09-17 21:34:00525A name that begins with `refs/` (e.g. `refs/heads/master`)
526that points to an <<def_object_name,object name>> or another
527ref (the latter is called a <<def_symref,symbolic ref>>).
528For convenience, a ref can sometimes be abbreviated when used
529as an argument to a Git command; see linkgit:gitrevisions[7]
530for details.
531Refs are stored in the <<def_repository,repository>>.
532+
533The ref namespace is hierarchical.
534Different subhierarchies are used for different purposes (e.g. the
535`refs/heads/` hierarchy is used to represent local branches).
536+
537There are a few special-purpose refs that do not begin with `refs/`.
538The most notable example is `HEAD`.
Junio C Hamano1a4e8412005-12-27 08:17:23539
Junio C Hamanobb0f4042007-07-04 06:41:40540[[def_reflog]]reflog::
541A reflog shows the local "history" of a ref. In other words,
542it can tell you what the 3rd last revision in _this_ repository
543was, and what was the current state in _this_ repository,
Junio C Hamano35738e82008-01-07 07:55:46544yesterday 9:14pm. See linkgit:git-reflog[1] for details.
Junio C Hamanobb0f4042007-07-04 06:41:40545
Junio C Hamano3d5b41f2007-03-26 02:33:41546[[def_refspec]]refspec::
Junio C Hamano36460982007-05-27 04:29:12547A "refspec" is used by <<def_fetch,fetch>> and
Junio C Hamano75485c82007-05-19 04:20:33548<<def_push,push>> to describe the mapping between remote
Junio C Hamanoe3f080d2013-04-22 02:27:13549<<def_ref,ref>> and local ref.
Junio C Hamano88a3a072006-05-04 08:01:43550
Junio C Hamano8c5d5942015-06-11 19:37:48551[[def_remote]]remote repository::
552A <<def_repository,repository>> which is used to track the same
553project but resides somewhere else. To communicate with remotes,
554see <<def_fetch,fetch>> or <<def_push,push>>.
555
Junio C Hamano97bcb482010-11-25 03:16:07556[[def_remote_tracking_branch]]remote-tracking branch::
Junio C Hamanoc7102962013-05-29 23:57:17557A <<def_ref,ref>> that is used to follow changes from another
558<<def_repository,repository>>. It typically looks like
559'refs/remotes/foo/bar' (indicating that it tracks a branch named
560'bar' in a remote named 'foo'), and matches the right-hand-side of
561a configured fetch <<def_refspec,refspec>>. A remote-tracking
562branch should not contain direct modifications or have local
563commits made to it.
Junio C Hamano97bcb482010-11-25 03:16:07564
Junio C Hamano3d5b41f2007-03-26 02:33:41565[[def_repository]]repository::
Junio C Hamano36460982007-05-27 04:29:12566A collection of <<def_ref,refs>> together with an
Junio C Hamano75485c82007-05-19 04:20:33567<<def_object_database,object database>> containing all objects
568which are <<def_reachable,reachable>> from the refs, possibly
Junio C Hamano36460982007-05-27 04:29:12569accompanied by meta data from one or more <<def_porcelain,porcelains>>. A
570repository can share an object database with other repositories
571via <<def_alternate_object_database,alternates mechanism>>.
Junio C Hamano88a3a072006-05-04 08:01:43572
Junio C Hamano3d5b41f2007-03-26 02:33:41573[[def_resolve]]resolve::
574The action of fixing up manually what a failed automatic
575<<def_merge,merge>> left behind.
Junio C Hamano88a3a072006-05-04 08:01:43576
Junio C Hamano3d5b41f2007-03-26 02:33:41577[[def_revision]]revision::
Junio C Hamanof26c77e2013-04-27 00:06:04578Synonym for <<def_commit,commit>> (the noun).
Junio C Hamano88a3a072006-05-04 08:01:43579
Junio C Hamano3d5b41f2007-03-26 02:33:41580[[def_rewind]]rewind::
581To throw away part of the development, i.e. to assign the
582<<def_head,head>> to an earlier <<def_revision,revision>>.
Junio C Hamano88a3a072006-05-04 08:01:43583
Junio C Hamano3d5b41f2007-03-26 02:33:41584[[def_SCM]]SCM::
Junio C Hamano88a3a072006-05-04 08:01:43585Source code management (tool).
586
Junio C Hamanoe3f080d2013-04-22 02:27:13587[[def_SHA1]]SHA-1::
588"Secure Hash Algorithm 1"; a cryptographic hash function.
589In the context of Git used as a synonym for <<def_object_name,object name>>.
Junio C Hamano88a3a072006-05-04 08:01:43590
Junio C Hamano4e6ba272016-01-20 23:23:19591[[def_shallow_clone]]shallow clone::
592Mostly a synonym to <<def_shallow_repository,shallow repository>>
593but the phrase makes it more explicit that it was created by
594running `git clone --depth=...` command.
595
Junio C Hamano3d5b41f2007-03-26 02:33:41596[[def_shallow_repository]]shallow repository::
Junio C Hamano36460982007-05-27 04:29:12597A shallow <<def_repository,repository>> has an incomplete
598history some of whose <<def_commit,commits>> have <<def_parent,parents>> cauterized away (in other
Junio C Hamano076ffcc2013-02-06 05:13:21599words, Git is told to pretend that these commits do not have the
Junio C Hamano3d5b41f2007-03-26 02:33:41600parents, even though they are recorded in the <<def_commit_object,commit
601object>>). This is sometimes useful when you are interested only in the
602recent history of a project even though the real history recorded in the
Junio C Hamano75485c82007-05-19 04:20:33603upstream is much larger. A shallow repository
Junio C Hamano35738e82008-01-07 07:55:46604is created by giving the `--depth` option to linkgit:git-clone[1], and
605its history can be later deepened with linkgit:git-fetch[1].
Junio C Hamano4f9a6052007-01-17 20:25:16606
Junio C Hamano967cda72017-06-30 21:49:53607[[def_stash]]stash entry::
608An <<def_object,object>> used to temporarily store the contents of a
609<<def_dirty,dirty>> working directory and the index for future reuse.
610
Junio C Hamano8c5d5942015-06-11 19:37:48611[[def_submodule]]submodule::
612A <<def_repository,repository>> that holds the history of a
613separate project inside another repository (the latter of
614which is called <<def_superproject, superproject>>).
615
616[[def_superproject]]superproject::
617A <<def_repository,repository>> that references repositories
618of other projects in its working tree as <<def_submodule,submodules>>.
619The superproject knows about the names of (but does not hold
620copies of) commit objects of the contained submodules.
621
Junio C Hamano3d5b41f2007-03-26 02:33:41622[[def_symref]]symref::
Junio C Hamanoe3f080d2013-04-22 02:27:13623Symbolic reference: instead of containing the <<def_SHA1,SHA-1>>
Junio C Hamano75485c82007-05-19 04:20:33624id itself, it is of the format 'ref: refs/some/thing' and when
625referenced, it recursively dereferences to this reference.
626'<<def_HEAD,HEAD>>' is a prime example of a symref. Symbolic
Junio C Hamano35738e82008-01-07 07:55:46627references are manipulated with the linkgit:git-symbolic-ref[1]
Junio C Hamano75485c82007-05-19 04:20:33628command.
Junio C Hamano3a971022006-11-18 22:17:58629
Junio C Hamano3d5b41f2007-03-26 02:33:41630[[def_tag]]tag::
Junio C Hamano360e3a12011-07-13 23:51:56631A <<def_ref,ref>> under `refs/tags/` namespace that points to an
632object of an arbitrary type (typically a tag points to either a
633<<def_tag_object,tag>> or a <<def_commit_object,commit object>>).
634In contrast to a <<def_head,head>>, a tag is not updated by
Junio C Hamano076ffcc2013-02-06 05:13:21635the `commit` command. A Git tag has nothing to do with a Lisp
Junio C Hamano360e3a12011-07-13 23:51:56636tag (which would be called an <<def_object_type,object type>>
Junio C Hamano076ffcc2013-02-06 05:13:21637in Git's context). A tag is most typically used to mark a particular
Junio C Hamano360e3a12011-07-13 23:51:56638point in the commit ancestry <<def_chain,chain>>.
Junio C Hamano88a3a072006-05-04 08:01:43639
Junio C Hamano3d5b41f2007-03-26 02:33:41640[[def_tag_object]]tag object::
641An <<def_object,object>> containing a <<def_ref,ref>> pointing to
Junio C Hamano75485c82007-05-19 04:20:33642another object, which can contain a message just like a
Junio C Hamano3d5b41f2007-03-26 02:33:41643<<def_commit_object,commit object>>. It can also contain a (PGP)
Junio C Hamano36460982007-05-27 04:29:12644signature, in which case it is called a "signed tag object".
Junio C Hamano88a3a072006-05-04 08:01:43645
Junio C Hamano3d5b41f2007-03-26 02:33:41646[[def_topic_branch]]topic branch::
Junio C Hamano076ffcc2013-02-06 05:13:21647A regular Git <<def_branch,branch>> that is used by a developer to
Junio C Hamano3d5b41f2007-03-26 02:33:41648identify a conceptual line of development. Since branches are very easy
649and inexpensive, it is often desirable to have several small branches
650that each contain very well defined concepts or small incremental yet
651related changes.
Junio C Hamano88a3a072006-05-04 08:01:43652
Junio C Hamano3d5b41f2007-03-26 02:33:41653[[def_tree]]tree::
654Either a <<def_working_tree,working tree>>, or a <<def_tree_object,tree
Junio C Hamano36460982007-05-27 04:29:12655object>> together with the dependent <<def_blob_object,blob>> and tree objects
Junio C Hamano75485c82007-05-19 04:20:33656(i.e. a stored representation of a working tree).
Junio C Hamano1a4e8412005-12-27 08:17:23657
Junio C Hamano3d5b41f2007-03-26 02:33:41658[[def_tree_object]]tree object::
659An <<def_object,object>> containing a list of file names and modes along
660with refs to the associated blob and/or tree objects. A
661<<def_tree,tree>> is equivalent to a <<def_directory,directory>>.
Junio C Hamano1a4e8412005-12-27 08:17:23662
Junio C Hamanoe6f28d02013-09-17 21:34:00663[[def_tree-ish]]tree-ish (also treeish)::
664A <<def_tree_object,tree object>> or an <<def_object,object>>
665that can be recursively dereferenced to a tree object.
666Dereferencing a <<def_commit_object,commit object>> yields the
667tree object corresponding to the <<def_revision,revision>>'s
668top <<def_directory,directory>>.
669The following are all tree-ishes:
670a <<def_commit-ish,commit-ish>>,
671a tree object,
672a <<def_tag_object,tag object>> that points to a tree object,
673a tag object that points to a tag object that points to a tree
674object,
675etc.
Junio C Hamano1a4e8412005-12-27 08:17:23676
Junio C Hamano3d5b41f2007-03-26 02:33:41677[[def_unmerged_index]]unmerged index::
678An <<def_index,index>> which contains unmerged
679<<def_index_entry,index entries>>.
Junio C Hamano1a4e8412005-12-27 08:17:23680
Junio C Hamano3d5b41f2007-03-26 02:33:41681[[def_unreachable_object]]unreachable object::
682An <<def_object,object>> which is not <<def_reachable,reachable>> from a
683<<def_branch,branch>>, <<def_tag,tag>>, or any other reference.
Junio C Hamanoaa83a7d2007-03-05 02:37:29684
Junio C Hamano98e32c32009-04-13 02:39:53685[[def_upstream_branch]]upstream branch::
686The default <<def_branch,branch>> that is merged into the branch in
687question (or the branch in question is rebased onto). It is configured
688via branch.<name>.remote and branch.<name>.merge. If the upstream branch
689of 'A' is 'origin/B' sometimes we say "'A' is tracking 'origin/B'".
690
Junio C Hamano3d5b41f2007-03-26 02:33:41691[[def_working_tree]]working tree::
Junio C Hamanoc0e55e72009-10-10 00:56:29692The tree of actual checked out files. The working tree normally
693contains the contents of the <<def_HEAD,HEAD>> commit's tree,
694plus any local changes that you have made but not yet committed.
Junio C Hamano99a21c32022-02-18 22:08:41695
696[[def_worktree]]worktree::
697A repository can have zero (i.e. bare repository) or one or
698more worktrees attached to it. One "worktree" consists of a
699"working tree" and repository metadata, most of which are
700shared among other worktrees of a single repository, and
701some of which are maintained separately per worktree
702(e.g. the index, HEAD and pseudorefs like MERGE_HEAD,
703per-worktree refs and per-worktree configuration file).