1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/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 (<literal>.git</literal>
\r
22 directory for a repository associated with your working tree, or
\r
23 <literal><project>.git</literal> directory for a public <emphasis>bare</emphasis> repository. It is
\r
24 also possible to have a working tree where <literal>.git</literal> is a plain
\r
25 ascii file containing <literal>gitdir: <path></literal>, 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 couple of ways to violate
\r
40 <orderedlist numeration="arabic">
\r
43 You could populate the repository by running a commit walker
\r
44 without <literal>-a</literal> option. Depending on which options are given, you
\r
45 could have only commit objects without associated blobs and
\r
46 trees this way, for example. A repository with this kind of
\r
47 incomplete object store is not suitable to be published to the
\r
48 outside world but sometimes useful for private repository.
\r
53 You also could have an incomplete but locally usable repository
\r
54 by cloning shallowly. See <xref linkend="git-clone(1)"/>.
\r
59 You can be using <literal>objects/info/alternates</literal> mechanism, or
\r
60 <literal>$GIT_ALTERNATE_OBJECT_DIRECTORIES</literal> mechanism to <emphasis>borrow</emphasis>
\r
61 objects from other object stores. A repository with this kind
\r
62 of incomplete object store is not suitable to be published for
\r
63 use with dumb transports but otherwise is OK as long as
\r
64 <literal>objects/info/alternates</literal> points at the right object stores
\r
73 objects/[0-9a-f][0-9a-f]
\r
77 Traditionally, each object is stored in its own file.
\r
78 They are split into 256 subdirectories using the first
\r
79 two letters from its object name to keep the number of
\r
80 directory entries <literal>objects</literal> directory itself needs to
\r
81 hold. Objects found here are often called <emphasis>unpacked</emphasis>
\r
82 (or <emphasis>loose</emphasis>) objects.
\r
92 Packs (files that store many object in compressed form,
\r
93 along with index files to allow them to be randomly
\r
94 accessed) are found in this directory.
\r
104 Additional information about the object store is
\r
105 recorded in this directory.
\r
115 This file is to help dumb transports discover what packs
\r
116 are available in this object store. Whenever a pack is
\r
117 added or removed, <literal>git update-server-info</literal> should be run
\r
118 to keep this file up-to-date if the repository is
\r
119 published for dumb transports. <emphasis>git-repack</emphasis> does this
\r
126 objects/info/alternates
\r
130 This file records paths to alternate object stores that
\r
131 this object store borrows objects from, one pathname per
\r
132 line. Note that not only native Git tools use it locally,
\r
133 but the HTTP fetcher also tries to use it remotely; this
\r
134 will usually work if you have relative paths (relative
\r
135 to the object database, not to the repository!) in your
\r
136 alternates file, but it will not work if you use absolute
\r
137 paths unless the absolute path in filesystem and web URL
\r
138 is the same. See also <emphasis>objects/info/http-alternates</emphasis>.
\r
144 objects/info/http-alternates
\r
148 This file records URLs to alternate object stores that
\r
149 this object store borrows objects from, to be used when
\r
150 the repository is fetched over HTTP.
\r
160 References are stored in subdirectories of this
\r
161 directory. The <emphasis>git-prune</emphasis> command knows to keep
\r
162 objects reachable from refs found in this directory and
\r
163 its subdirectories.
\r
169 refs/heads/<literal>name</literal>
\r
173 records tip-of-the-tree commit objects of branch <literal>name</literal>
\r
179 refs/tags/<literal>name</literal>
\r
183 records any object name (not necessarily a commit
\r
184 object, or a tag object that points at a commit object).
\r
190 refs/remotes/<literal>name</literal>
\r
194 records tip-of-the-tree commit objects of branches copied
\r
195 from a remote repository.
\r
205 records the same information as refs/heads/, refs/tags/,
\r
206 and friends record in a more efficient way. See
\r
207 <xref linkend="git-pack-refs(1)"/>.
\r
217 A symref (see glossary) to the <literal>refs/heads/</literal> namespace
\r
218 describing the currently active branch. It does not mean
\r
219 much if the repository is not associated with any working tree
\r
220 (i.e. a <emphasis>bare</emphasis> repository), but a valid git repository
\r
221 <emphasis role="strong">must</emphasis> have the HEAD file; some porcelains may use it to
\r
222 guess the designated "default" branch of the repository
\r
223 (usually <emphasis>master</emphasis>). It is legal if the named branch
\r
224 <emphasis>name</emphasis> does not (yet) exist. In some legacy setups, it is
\r
225 a symbolic link instead of a symref that points at the current
\r
228 <simpara>HEAD can also record a specific commit directly, instead of
\r
229 being a symref to point at the current branch. Such a state
\r
230 is often called <emphasis>detached HEAD</emphasis>, and almost all commands work
\r
231 identically as normal. See <xref linkend="git-checkout(1)"/> for
\r
241 A slightly deprecated way to store shorthands to be used
\r
242 to specify URL to <emphasis>git-fetch</emphasis>, <emphasis>git-pull</emphasis> and <emphasis>git-push</emphasis>
\r
243 commands is to store a file in <literal>branches/<name></literal> and
\r
244 give <emphasis>name</emphasis> to these commands in place of <emphasis>repository</emphasis>
\r
255 Hooks are customization scripts used by various git
\r
256 commands. A handful of sample hooks are installed when
\r
257 <emphasis>git-init</emphasis> is run, but all of them are disabled by
\r
258 default. To enable, the <literal>.sample</literal> suffix has to be
\r
259 removed from the filename by renaming.
\r
260 Read <xref linkend="githooks(5)"/> for more details about
\r
271 The current index file for the repository. It is
\r
272 usually not found in a bare repository.
\r
282 Additional information about the repository is recorded
\r
293 This file helps dumb transports discover what refs are
\r
294 available in this repository. If the repository is
\r
295 published for dumb transports, this file should be
\r
296 regenerated by <emphasis>git-update-server-info</emphasis> every time a tag
\r
297 or branch is created or modified. This is normally done
\r
298 from the <literal>hooks/update</literal> hook, which is run by the
\r
299 <emphasis>git-receive-pack</emphasis> command when you <emphasis>git-push</emphasis> into the
\r
310 This file records fake commit ancestry information, to
\r
311 pretend the set of parents a commit has is different
\r
312 from how the commit was actually created. One record
\r
313 per line describes a commit and its fake parents by
\r
314 listing their 40-byte hexadecimal object names separated
\r
315 by a space and terminated by a newline.
\r
325 This file, by convention among Porcelains, stores the
\r
326 exclude pattern list. <literal>.gitignore</literal> is the per-directory
\r
327 ignore file. <emphasis>git-status</emphasis>, <emphasis>git-add</emphasis>, <emphasis>git-rm</emphasis> and
\r
328 <emphasis>git-clean</emphasis> look at it but the core git commands do not look
\r
329 at it. See also: <xref linkend="gitignore(5)"/>.
\r
339 Stores shorthands to be used to give URL and default
\r
340 refnames to interact with remote repository to
\r
341 <emphasis>git-fetch</emphasis>, <emphasis>git-pull</emphasis> and <emphasis>git-push</emphasis> commands.
\r
351 Records of changes made to refs are stored in this
\r
352 directory. See <xref linkend="git-update-ref(1)"/>
\r
353 for more information.
\r
359 logs/refs/heads/<literal>name</literal>
\r
363 Records all changes made to the branch tip named <literal>name</literal>.
\r
369 logs/refs/tags/<literal>name</literal>
\r
373 Records all changes made to the tag named <literal>name</literal>.
\r
383 This is similar to <literal>info/grafts</literal> but is internally used
\r
384 and maintained by shallow clone mechanism. See <literal>--depth</literal>
\r
385 option to <xref linkend="git-clone(1)"/> and <xref linkend="git-fetch(1)"/>.
\r
391 <simplesect id="_see_also">
\r
392 <title>SEE ALSO</title>
\r
393 <simpara><xref linkend="git-init(1)"/>,
\r
394 <xref linkend="git-clone(1)"/>,
\r
395 <xref linkend="git-fetch(1)"/>,
\r
396 <xref linkend="git-pack-refs(1)"/>,
\r
397 <xref linkend="git-gc(1)"/>,
\r
398 <xref linkend="git-checkout(1)"/>,
\r
399 <xref linkend="gitglossary(7)"/>,
\r
400 <ulink url="user-manual.html">The Git User’s Manual</ulink></simpara>
\r
402 <simplesect id="_git">
\r
404 <simpara>Part of the <xref linkend="git(1)"/> suite.</simpara>
\r