blob: 1befca98d49583b42e652b4ce21fccb89b5b5cdb [file] [log] [blame]
Junio C Hamanof7c042d2008-06-06 22:50:531gitrepository-layout(5)
2=======================
3
4NAME
5----
6gitrepository-layout - Git Repository Layout
7
8SYNOPSIS
9--------
10$GIT_DIR/*
11
12DESCRIPTION
13-----------
Junio C Hamano1a4e8412005-12-27 08:17:2314
15You may find these things in your git repository (`.git`
16directory for a repository associated with your working tree, or
Junio C Hamanof7c042d2008-06-06 22:50:5317`<project>.git` directory for a public 'bare' repository. It is
Junio C Hamano47d68a52008-05-06 06:35:4018also possible to have a working tree where `.git` is a plain
19ascii file containing `gitdir: <path>`, i.e. the path to the
20real git repository).
Junio C Hamano1a4e8412005-12-27 08:17:2321
22objects::
23Object store associated with this repository. Usually
24an object store is self sufficient (i.e. all the objects
25that are referred to by an object found in it are also
26found in it), but there are couple of ways to violate
27it.
28+
29. You could populate the repository by running a commit walker
30without `-a` option. Depending on which options are given, you
31could have only commit objects without associated blobs and
32trees this way, for example. A repository with this kind of
33incomplete object store is not suitable to be published to the
34outside world but sometimes useful for private repository.
Junio C Hamano4f9a6052007-01-17 20:25:1635. You also could have an incomplete but locally usable repository
Junio C Hamano35738e82008-01-07 07:55:4636by cloning shallowly. See linkgit:git-clone[1].
Junio C Hamano1a4e8412005-12-27 08:17:2337. You can be using `objects/info/alternates` mechanism, or
38`$GIT_ALTERNATE_OBJECT_DIRECTORIES` mechanism to 'borrow'
39objects from other object stores. A repository with this kind
Junio C Hamano235a91e2006-01-07 01:13:5840of incomplete object store is not suitable to be published for
Junio C Hamano1a4e8412005-12-27 08:17:2341use with dumb transports but otherwise is OK as long as
42`objects/info/alternates` points at the right object stores
43it borrows from.
44
45objects/[0-9a-f][0-9a-f]::
46Traditionally, each object is stored in its own file.
47They are split into 256 subdirectories using the first
48two letters from its object name to keep the number of
49directory entries `objects` directory itself needs to
50hold. Objects found here are often called 'unpacked'
Junio C Hamano4f9a6052007-01-17 20:25:1651(or 'loose') objects.
Junio C Hamano1a4e8412005-12-27 08:17:2352
53objects/pack::
54Packs (files that store many object in compressed form,
55along with index files to allow them to be randomly
56accessed) are found in this directory.
57
58objects/info::
59Additional information about the object store is
60recorded in this directory.
61
62objects/info/packs::
63This file is to help dumb transports discover what packs
64are available in this object store. Whenever a pack is
65added or removed, `git update-server-info` should be run
66to keep this file up-to-date if the repository is
Junio C Hamanoba4b9282008-07-06 05:20:3167published for dumb transports. 'git-repack' does this
Junio C Hamano1a4e8412005-12-27 08:17:2368by default.
69
70objects/info/alternates::
Junio C Hamano93ba9d32006-11-20 03:17:4371This file records paths to alternate object stores that
72this object store borrows objects from, one pathname per
73line. Note that not only native Git tools use it locally,
74but the HTTP fetcher also tries to use it remotely; this
75will usually work if you have relative paths (relative
76to the object database, not to the repository!) in your
77alternates file, but it will not work if you use absolute
78paths unless the absolute path in filesystem and web URL
79is the same. See also 'objects/info/http-alternates'.
80
81objects/info/http-alternates::
82This file records URLs to alternate object stores that
83this object store borrows objects from, to be used when
84the repository is fetched over HTTP.
Junio C Hamano1a4e8412005-12-27 08:17:2385
86refs::
87References are stored in subdirectories of this
Junio C Hamanoba4b9282008-07-06 05:20:3188directory. The 'git-prune' command knows to keep
Junio C Hamano1a4e8412005-12-27 08:17:2389objects reachable from refs found in this directory and
90its subdirectories.
91
92refs/heads/`name`::
93records tip-of-the-tree commit objects of branch `name`
94
95refs/tags/`name`::
96records any object name (not necessarily a commit
97object, or a tag object that points at a commit object).
98
Junio C Hamano4f9a6052007-01-17 20:25:1699refs/remotes/`name`::
100records tip-of-the-tree commit objects of branches copied
101from a remote repository.
102
103packed-refs::
104records the same information as refs/heads/, refs/tags/,
105and friends record in a more efficient way. See
Junio C Hamano35738e82008-01-07 07:55:46106linkgit:git-pack-refs[1].
Junio C Hamano4f9a6052007-01-17 20:25:16107
Junio C Hamano1a4e8412005-12-27 08:17:23108HEAD::
Junio C Hamano3a971022006-11-18 22:17:58109A symref (see glossary) to the `refs/heads/` namespace
110describing the currently active branch. It does not mean
111much if the repository is not associated with any working tree
Junio C Hamanoe663a7a2006-01-25 12:37:28112(i.e. a 'bare' repository), but a valid git repository
Junio C Hamano3a971022006-11-18 22:17:58113*must* have the HEAD file; some porcelains may use it to
114guess the designated "default" branch of the repository
115(usually 'master'). It is legal if the named branch
116'name' does not (yet) exist. In some legacy setups, it is
117a symbolic link instead of a symref that points at the current
118branch.
Junio C Hamano4f9a6052007-01-17 20:25:16119+
120HEAD can also record a specific commit directly, instead of
121being a symref to point at the current branch. Such a state
122is often called 'detached HEAD', and almost all commands work
Junio C Hamano35738e82008-01-07 07:55:46123identically as normal. See linkgit:git-checkout[1] for
Junio C Hamano4f9a6052007-01-17 20:25:16124details.
Junio C Hamano1a4e8412005-12-27 08:17:23125
126branches::
127A slightly deprecated way to store shorthands to be used
Junio C Hamanoba4b9282008-07-06 05:20:31128to specify URL to 'git-fetch', 'git-pull' and 'git-push'
Junio C Hamanof7c042d2008-06-06 22:50:53129commands is to store a file in `branches/<name>` and
Junio C Hamano1a4e8412005-12-27 08:17:23130give 'name' to these commands in place of 'repository'
131argument.
132
133hooks::
134Hooks are customization scripts used by various git
135commands. A handful of sample hooks are installed when
Junio C Hamanoba4b9282008-07-06 05:20:31136'git-init' is run, but all of them are disabled by
Junio C Hamano116db352008-12-17 19:48:40137default. To enable, the `.sample` suffix has to be
138removed from the filename by renaming.
Junio C Hamanofce7c7e2008-07-02 03:06:38139Read linkgit:githooks[5] for more details about
Junio C Hamano818f7d62006-03-26 01:49:30140each hook.
Junio C Hamano1a4e8412005-12-27 08:17:23141
142index::
143The current index file for the repository. It is
Junio C Hamanoe663a7a2006-01-25 12:37:28144usually not found in a bare repository.
Junio C Hamano1a4e8412005-12-27 08:17:23145
146info::
147Additional information about the repository is recorded
148in this directory.
149
150info/refs::
Junio C Hamano78ded482007-02-13 07:50:48151This file helps dumb transports discover what refs are
152available in this repository. If the repository is
153published for dumb transports, this file should be
Junio C Hamanoba4b9282008-07-06 05:20:31154regenerated by 'git-update-server-info' every time a tag
Junio C Hamano78ded482007-02-13 07:50:48155or branch is created or modified. This is normally done
156from the `hooks/update` hook, which is run by the
Junio C Hamanoba4b9282008-07-06 05:20:31157'git-receive-pack' command when you 'git-push' into the
Junio C Hamano78ded482007-02-13 07:50:48158repository.
Junio C Hamano1a4e8412005-12-27 08:17:23159
160info/grafts::
161This file records fake commit ancestry information, to
162pretend the set of parents a commit has is different
163from how the commit was actually created. One record
164per line describes a commit and its fake parents by
165listing their 40-byte hexadecimal object names separated
166by a space and terminated by a newline.
167
168info/exclude::
169This file, by convention among Porcelains, stores the
Junio C Hamano7ccb9fd2006-07-15 01:38:40170exclude pattern list. `.gitignore` is the per-directory
Junio C Hamanoba4b9282008-07-06 05:20:31171ignore file. 'git-status', 'git-add', 'git-rm' and
172'git-clean' look at it but the core git commands do not look
Junio C Hamano35738e82008-01-07 07:55:46173at it. See also: linkgit:gitignore[5].
Junio C Hamano1a4e8412005-12-27 08:17:23174
175remotes::
176Stores shorthands to be used to give URL and default
Junio C Hamanofce7c7e2008-07-02 03:06:38177refnames to interact with remote repository to
Junio C Hamanoba4b9282008-07-06 05:20:31178'git-fetch', 'git-pull' and 'git-push' commands.
Junio C Hamano341071d2006-06-04 07:24:48179
180logs::
181Records of changes made to refs are stored in this
Junio C Hamanofce7c7e2008-07-02 03:06:38182directory. See linkgit:git-update-ref[1]
Junio C Hamano341071d2006-06-04 07:24:48183for more information.
184
185logs/refs/heads/`name`::
186Records all changes made to the branch tip named `name`.
187
188logs/refs/tags/`name`::
189Records all changes made to the tag named `name`.
Junio C Hamano4f9a6052007-01-17 20:25:16190
191shallow::
192This is similar to `info/grafts` but is internally used
193and maintained by shallow clone mechanism. See `--depth`
Junio C Hamano35738e82008-01-07 07:55:46194option to linkgit:git-clone[1] and linkgit:git-fetch[1].
Junio C Hamanof7c042d2008-06-06 22:50:53195
196SEE ALSO
197--------
198linkgit:git-init[1],
199linkgit:git-clone[1],
200linkgit:git-fetch[1],
201linkgit:git-pack-refs[1],
202linkgit:git-gc[1],
203linkgit:git-checkout[1],
204linkgit:gitglossary[7],
205link:user-manual.html[The Git User's Manual]
206
207GIT
208---
209Part of the linkgit:git[1] suite.