1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
\r
4 <article lang="en" id="gitrepository-layout(5)">
\r
6 <title>gitrepository-layout(5)</title>
\r
8 <primary>gitrepository-layout(5)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>gitrepository-layout - Git Repository Layout</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
17 <simpara>$GIT_DIR/*</simpara>
\r
19 <simplesect id="_description">
\r
20 <title>DESCRIPTION</title>
\r
21 <simpara>You may find these things in your git repository (<emphasis>.git</emphasis>
\r
22 directory for a repository associated with your working tree, or
\r
23 <emphasis><project>.git</emphasis> directory for a public <emphasis>bare</emphasis> repository. It is
\r
24 also possible to have a working tree where <emphasis>.git</emphasis> is a plain
\r
25 ASCII file containing <emphasis>gitdir: <path></emphasis>, i.e. the path to the
\r
26 real git repository).</simpara>
\r
34 Object store associated with this repository. Usually
\r
35 an object store is self sufficient (i.e. all the objects
\r
36 that are referred to by an object found in it are also
\r
37 found in it), but there are a few ways to violate it.
\r
39 <orderedlist numeration="arabic">
\r
42 You could have an incomplete but locally usable repository
\r
43 by creating a shallow clone. See <xref linkend="git-clone(1)" />.
\r
48 You could be using the <emphasis>objects/info/alternates</emphasis> or
\r
49 <emphasis>$GIT_ALTERNATE_OBJECT_DIRECTORIES</emphasis> mechanisms to <emphasis>borrow</emphasis>
\r
50 objects from other object stores. A repository with this kind
\r
51 of incomplete object store is not suitable to be published for
\r
52 use with dumb transports but otherwise is OK as long as
\r
53 <emphasis>objects/info/alternates</emphasis> points at the object stores it
\r
62 objects/[0-9a-f][0-9a-f]
\r
66 A newly created object is stored in its own file.
\r
67 The objects are splayed over 256 subdirectories using
\r
68 the first two characters of the sha1 object name to
\r
69 keep the number of directory entries in <emphasis>objects</emphasis>
\r
70 itself to a manageable number. Objects found
\r
71 here are often called <emphasis>unpacked</emphasis> (or <emphasis>loose</emphasis>) objects.
\r
81 Packs (files that store many object in compressed form,
\r
82 along with index files to allow them to be randomly
\r
83 accessed) are found in this directory.
\r
93 Additional information about the object store is
\r
94 recorded in this directory.
\r
104 This file is to help dumb transports discover what packs
\r
105 are available in this object store. Whenever a pack is
\r
106 added or removed, <emphasis>git update-server-info</emphasis> should be run
\r
107 to keep this file up-to-date if the repository is
\r
108 published for dumb transports. <emphasis>git repack</emphasis> does this
\r
115 objects/info/alternates
\r
119 This file records paths to alternate object stores that
\r
120 this object store borrows objects from, one pathname per
\r
121 line. Note that not only native Git tools use it locally,
\r
122 but the HTTP fetcher also tries to use it remotely; this
\r
123 will usually work if you have relative paths (relative
\r
124 to the object database, not to the repository!) in your
\r
125 alternates file, but it will not work if you use absolute
\r
126 paths unless the absolute path in filesystem and web URL
\r
127 is the same. See also <emphasis>objects/info/http-alternates</emphasis>.
\r
133 objects/info/http-alternates
\r
137 This file records URLs to alternate object stores that
\r
138 this object store borrows objects from, to be used when
\r
139 the repository is fetched over HTTP.
\r
149 References are stored in subdirectories of this
\r
150 directory. The <emphasis>git prune</emphasis> command knows to preserve
\r
151 objects reachable from refs found in this directory and
\r
152 its subdirectories.
\r
158 refs/heads/<emphasis>name</emphasis>
\r
162 records tip-of-the-tree commit objects of branch <emphasis>name</emphasis>
\r
168 refs/tags/<emphasis>name</emphasis>
\r
172 records any object name (not necessarily a commit
\r
173 object, or a tag object that points at a commit object).
\r
179 refs/remotes/<emphasis>name</emphasis>
\r
183 records tip-of-the-tree commit objects of branches copied
\r
184 from a remote repository.
\r
194 records the same information as refs/heads/, refs/tags/,
\r
195 and friends record in a more efficient way. See
\r
196 <xref linkend="git-pack-refs(1)" />.
\r
206 A symref (see glossary) to the <emphasis>refs/heads/</emphasis> namespace
\r
207 describing the currently active branch. It does not mean
\r
208 much if the repository is not associated with any working tree
\r
209 (i.e. a <emphasis>bare</emphasis> repository), but a valid git repository
\r
210 <emphasis role="strong">must</emphasis> have the HEAD file; some porcelains may use it to
\r
211 guess the designated "default" branch of the repository
\r
212 (usually <emphasis>master</emphasis>). It is legal if the named branch
\r
213 <emphasis>name</emphasis> does not (yet) exist. In some legacy setups, it is
\r
214 a symbolic link instead of a symref that points at the current
\r
217 <simpara>HEAD can also record a specific commit directly, instead of
\r
218 being a symref to point at the current branch. Such a state
\r
219 is often called <emphasis>detached HEAD.</emphasis> See <xref linkend="git-checkout(1)" />
\r
220 for details.</simpara>
\r
229 A slightly deprecated way to store shorthands to be used
\r
230 to specify a URL to <emphasis>git fetch</emphasis>, <emphasis>git pull</emphasis> and <emphasis>git push</emphasis>.
\r
231 A file can be stored as <emphasis>branches/<name></emphasis> and then
\r
232 <emphasis>name</emphasis> can be given to these commands in place of
\r
233 <emphasis>repository</emphasis> argument. See the REMOTES section in
\r
234 <xref linkend="git-fetch(1)" /> for details. This mechanism is legacy
\r
235 and not likely to be found in modern repositories.
\r
245 Hooks are customization scripts used by various git
\r
246 commands. A handful of sample hooks are installed when
\r
247 <emphasis>git init</emphasis> is run, but all of them are disabled by
\r
248 default. To enable, the <emphasis>.sample</emphasis> suffix has to be
\r
249 removed from the filename by renaming.
\r
250 Read <xref linkend="githooks(5)" /> for more details about
\r
261 The current index file for the repository. It is
\r
262 usually not found in a bare repository.
\r
272 Additional information about the repository is recorded
\r
283 This file helps dumb transports discover what refs are
\r
284 available in this repository. If the repository is
\r
285 published for dumb transports, this file should be
\r
286 regenerated by <emphasis>git update-server-info</emphasis> every time a tag
\r
287 or branch is created or modified. This is normally done
\r
288 from the <emphasis>hooks/update</emphasis> hook, which is run by the
\r
289 <emphasis>git-receive-pack</emphasis> command when you <emphasis>git push</emphasis> into the
\r
300 This file records fake commit ancestry information, to
\r
301 pretend the set of parents a commit has is different
\r
302 from how the commit was actually created. One record
\r
303 per line describes a commit and its fake parents by
\r
304 listing their 40-byte hexadecimal object names separated
\r
305 by a space and terminated by a newline.
\r
315 This file, by convention among Porcelains, stores the
\r
316 exclude pattern list. <emphasis>.gitignore</emphasis> is the per-directory
\r
317 ignore file. <emphasis>git status</emphasis>, <emphasis>git add</emphasis>, <emphasis>git rm</emphasis> and
\r
318 <emphasis>git clean</emphasis> look at it but the core git commands do not look
\r
319 at it. See also: <xref linkend="gitignore(5)" />.
\r
329 Stores shorthands for URL and default refnames for use
\r
330 when interacting with remote repositories via <emphasis>git fetch</emphasis>,
\r
331 <emphasis>git pull</emphasis> and <emphasis>git push</emphasis> commands. See the REMOTES section
\r
332 in <xref linkend="git-fetch(1)" /> for details. This mechanism is legacy
\r
333 and not likely to be found in modern repositories.
\r
343 Records of changes made to refs are stored in this
\r
344 directory. See <xref linkend="git-update-ref(1)" />
\r
345 for more information.
\r
351 logs/refs/heads/<emphasis>name</emphasis>
\r
355 Records all changes made to the branch tip named <emphasis>name</emphasis>.
\r
361 logs/refs/tags/<emphasis>name</emphasis>
\r
365 Records all changes made to the tag named <emphasis>name</emphasis>.
\r
375 This is similar to <emphasis>info/grafts</emphasis> but is internally used
\r
376 and maintained by shallow clone mechanism. See <emphasis>--depth</emphasis>
\r
377 option to <xref linkend="git-clone(1)" /> and <xref linkend="git-fetch(1)" />.
\r
383 <simplesect id="_see_also">
\r
384 <title>SEE ALSO</title>
\r
385 <simpara><xref linkend="git-init(1)" />,
\r
386 <xref linkend="git-clone(1)" />,
\r
387 <xref linkend="git-fetch(1)" />,
\r
388 <xref linkend="git-pack-refs(1)" />,
\r
389 <xref linkend="git-gc(1)" />,
\r
390 <xref linkend="git-checkout(1)" />,
\r
391 <xref linkend="gitglossary(7)" />,
\r
392 link:user-manual.html[The Git User's Manual]</simpara>
\r
394 <simplesect id="_git">
\r
396 <simpara>Part of the <xref linkend="git(1)" /> suite.</simpara>
\r