blob: 5c891f1169b35e53bccc19f0423b5b7e98db720b [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
Junio C Hamano619596a2010-08-18 22:15:3519ASCII file containing `gitdir: <path>`, i.e. the path to the
Junio C Hamano47d68a52008-05-06 06:35:4020real 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
Junio C Hamano6e41cb32011-08-29 07:12:4926found in it), but there are a few ways to violate it.
Junio C Hamano1a4e8412005-12-27 08:17:2327+
Junio C Hamano6e41cb32011-08-29 07:12:4928. You could have an incomplete but locally usable repository
29by creating a shallow clone. See linkgit:git-clone[1].
30. You could be using the `objects/info/alternates` or
31`$GIT_ALTERNATE_OBJECT_DIRECTORIES` mechanisms to 'borrow'
Junio C Hamano1a4e8412005-12-27 08:17:2332objects from other object stores. A repository with this kind
Junio C Hamano235a91e2006-01-07 01:13:5833of incomplete object store is not suitable to be published for
Junio C Hamano1a4e8412005-12-27 08:17:2334use with dumb transports but otherwise is OK as long as
Junio C Hamano6e41cb32011-08-29 07:12:4935`objects/info/alternates` points at the object stores it
36borrows from.
Junio C Hamano1a4e8412005-12-27 08:17:2337
38objects/[0-9a-f][0-9a-f]::
Junio C Hamano6e41cb32011-08-29 07:12:4939A newly created object is stored in its own file.
40The objects are splayed over 256 subdirectories using
41the first two characters of the sha1 object name to
42keep the number of directory entries in `objects`
43itself to a manageable number. Objects found
44here are often called 'unpacked' (or 'loose') objects.
Junio C Hamano1a4e8412005-12-27 08:17:2345
46objects/pack::
47Packs (files that store many object in compressed form,
48along with index files to allow them to be randomly
49accessed) are found in this directory.
50
51objects/info::
52Additional information about the object store is
53recorded in this directory.
54
55objects/info/packs::
56This file is to help dumb transports discover what packs
57are available in this object store. Whenever a pack is
58added or removed, `git update-server-info` should be run
59to keep this file up-to-date if the repository is
Junio C Hamano1aa40d22010-01-21 17:46:4360published for dumb transports. 'git repack' does this
Junio C Hamano1a4e8412005-12-27 08:17:2361by default.
62
63objects/info/alternates::
Junio C Hamano93ba9d32006-11-20 03:17:4364This file records paths to alternate object stores that
65this object store borrows objects from, one pathname per
66line. Note that not only native Git tools use it locally,
67but the HTTP fetcher also tries to use it remotely; this
68will usually work if you have relative paths (relative
69to the object database, not to the repository!) in your
70alternates file, but it will not work if you use absolute
71paths unless the absolute path in filesystem and web URL
72is the same. See also 'objects/info/http-alternates'.
73
74objects/info/http-alternates::
75This file records URLs to alternate object stores that
76this object store borrows objects from, to be used when
77the repository is fetched over HTTP.
Junio C Hamano1a4e8412005-12-27 08:17:2378
79refs::
80References are stored in subdirectories of this
Junio C Hamano6e41cb32011-08-29 07:12:4981directory. The 'git prune' command knows to preserve
Junio C Hamano1a4e8412005-12-27 08:17:2382objects reachable from refs found in this directory and
83its subdirectories.
84
85refs/heads/`name`::
86records tip-of-the-tree commit objects of branch `name`
87
88refs/tags/`name`::
89records any object name (not necessarily a commit
90object, or a tag object that points at a commit object).
91
Junio C Hamano4f9a6052007-01-17 20:25:1692refs/remotes/`name`::
93records tip-of-the-tree commit objects of branches copied
94from a remote repository.
95
96packed-refs::
97records the same information as refs/heads/, refs/tags/,
98and friends record in a more efficient way. See
Junio C Hamano35738e82008-01-07 07:55:4699linkgit:git-pack-refs[1].
Junio C Hamano4f9a6052007-01-17 20:25:16100
Junio C Hamano1a4e8412005-12-27 08:17:23101HEAD::
Junio C Hamano3a971022006-11-18 22:17:58102A symref (see glossary) to the `refs/heads/` namespace
103describing the currently active branch. It does not mean
104much if the repository is not associated with any working tree
Junio C Hamanoe663a7a2006-01-25 12:37:28105(i.e. a 'bare' repository), but a valid git repository
Junio C Hamano3a971022006-11-18 22:17:58106*must* have the HEAD file; some porcelains may use it to
107guess the designated "default" branch of the repository
108(usually 'master'). It is legal if the named branch
109'name' does not (yet) exist. In some legacy setups, it is
110a symbolic link instead of a symref that points at the current
111branch.
Junio C Hamano4f9a6052007-01-17 20:25:16112+
113HEAD can also record a specific commit directly, instead of
114being a symref to point at the current branch. Such a state
Junio C Hamano6e41cb32011-08-29 07:12:49115is often called 'detached HEAD.' See linkgit:git-checkout[1]
116for details.
Junio C Hamano1a4e8412005-12-27 08:17:23117
118branches::
119A slightly deprecated way to store shorthands to be used
Junio C Hamano6e41cb32011-08-29 07:12:49120to specify a URL to 'git fetch', 'git pull' and 'git push'.
121A file can be stored as `branches/<name>` and then
122'name' can be given to these commands in place of
123'repository' argument. See the REMOTES section in
124linkgit:git-fetch[1] for details. This mechanism is legacy
125and not likely to be found in modern repositories.
Junio C Hamano1a4e8412005-12-27 08:17:23126
127hooks::
128Hooks are customization scripts used by various git
129commands. A handful of sample hooks are installed when
Junio C Hamano1aa40d22010-01-21 17:46:43130'git init' is run, but all of them are disabled by
Junio C Hamano116db352008-12-17 19:48:40131default. To enable, the `.sample` suffix has to be
132removed from the filename by renaming.
Junio C Hamanofce7c7e2008-07-02 03:06:38133Read linkgit:githooks[5] for more details about
Junio C Hamano818f7d62006-03-26 01:49:30134each hook.
Junio C Hamano1a4e8412005-12-27 08:17:23135
136index::
137The current index file for the repository. It is
Junio C Hamanoe663a7a2006-01-25 12:37:28138usually not found in a bare repository.
Junio C Hamano1a4e8412005-12-27 08:17:23139
140info::
141Additional information about the repository is recorded
142in this directory.
143
144info/refs::
Junio C Hamano78ded482007-02-13 07:50:48145This file helps dumb transports discover what refs are
146available in this repository. If the repository is
147published for dumb transports, this file should be
Junio C Hamano1aa40d22010-01-21 17:46:43148regenerated by 'git update-server-info' every time a tag
Junio C Hamano78ded482007-02-13 07:50:48149or branch is created or modified. This is normally done
150from the `hooks/update` hook, which is run by the
Junio C Hamano1aa40d22010-01-21 17:46:43151'git-receive-pack' command when you 'git push' into the
Junio C Hamano78ded482007-02-13 07:50:48152repository.
Junio C Hamano1a4e8412005-12-27 08:17:23153
154info/grafts::
155This file records fake commit ancestry information, to
156pretend the set of parents a commit has is different
157from how the commit was actually created. One record
158per line describes a commit and its fake parents by
159listing their 40-byte hexadecimal object names separated
160by a space and terminated by a newline.
161
162info/exclude::
163This file, by convention among Porcelains, stores the
Junio C Hamano7ccb9fd2006-07-15 01:38:40164exclude pattern list. `.gitignore` is the per-directory
Junio C Hamano1aa40d22010-01-21 17:46:43165ignore file. 'git status', 'git add', 'git rm' and
166'git clean' look at it but the core git commands do not look
Junio C Hamano35738e82008-01-07 07:55:46167at it. See also: linkgit:gitignore[5].
Junio C Hamano1a4e8412005-12-27 08:17:23168
169remotes::
Junio C Hamano6e41cb32011-08-29 07:12:49170Stores shorthands for URL and default refnames for use
171when interacting with remote repositories via 'git fetch',
172'git pull' and 'git push' commands. See the REMOTES section
173in linkgit:git-fetch[1] for details. This mechanism is legacy
174and not likely to be found in modern repositories.
Junio C Hamano341071d2006-06-04 07:24:48175
176logs::
177Records of changes made to refs are stored in this
Junio C Hamanofce7c7e2008-07-02 03:06:38178directory. See linkgit:git-update-ref[1]
Junio C Hamano341071d2006-06-04 07:24:48179for more information.
180
181logs/refs/heads/`name`::
182Records all changes made to the branch tip named `name`.
183
184logs/refs/tags/`name`::
185Records all changes made to the tag named `name`.
Junio C Hamano4f9a6052007-01-17 20:25:16186
187shallow::
188This is similar to `info/grafts` but is internally used
189and maintained by shallow clone mechanism. See `--depth`
Junio C Hamano35738e82008-01-07 07:55:46190option to linkgit:git-clone[1] and linkgit:git-fetch[1].
Junio C Hamanof7c042d2008-06-06 22:50:53191
192SEE ALSO
193--------
194linkgit:git-init[1],
195linkgit:git-clone[1],
196linkgit:git-fetch[1],
197linkgit:git-pack-refs[1],
198linkgit:git-gc[1],
199linkgit:git-checkout[1],
200linkgit:gitglossary[7],
201link:user-manual.html[The Git User's Manual]
202
203GIT
204---
205Part of the linkgit:git[1] suite.