blob: 98fbe7db5279a4078364121d3c1622e1209aac49 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git repository layout
2=====================
3
4You may find these things in your git repository (`.git`
5directory for a repository associated with your working tree, or
Junio C Hamanoe663a7a2006-01-25 12:37:286`'project'.git` directory for a public 'bare' repository).
Junio C Hamano1a4e8412005-12-27 08:17:237
8objects::
9Object store associated with this repository. Usually
10an object store is self sufficient (i.e. all the objects
11that are referred to by an object found in it are also
12found in it), but there are couple of ways to violate
13it.
14+
15. You could populate the repository by running a commit walker
16without `-a` option. Depending on which options are given, you
17could have only commit objects without associated blobs and
18trees this way, for example. A repository with this kind of
19incomplete object store is not suitable to be published to the
20outside world but sometimes useful for private repository.
21. You can be using `objects/info/alternates` mechanism, or
22`$GIT_ALTERNATE_OBJECT_DIRECTORIES` mechanism to 'borrow'
23objects from other object stores. A repository with this kind
Junio C Hamano235a91e2006-01-07 01:13:5824of incomplete object store is not suitable to be published for
Junio C Hamano1a4e8412005-12-27 08:17:2325use with dumb transports but otherwise is OK as long as
26`objects/info/alternates` points at the right object stores
27it borrows from.
28
29objects/[0-9a-f][0-9a-f]::
30Traditionally, each object is stored in its own file.
31They are split into 256 subdirectories using the first
32two letters from its object name to keep the number of
33directory entries `objects` directory itself needs to
34hold. Objects found here are often called 'unpacked'
35objects.
36
37objects/pack::
38Packs (files that store many object in compressed form,
39along with index files to allow them to be randomly
40accessed) are found in this directory.
41
42objects/info::
43Additional information about the object store is
44recorded in this directory.
45
46objects/info/packs::
47This file is to help dumb transports discover what packs
48are available in this object store. Whenever a pack is
49added or removed, `git update-server-info` should be run
50to keep this file up-to-date if the repository is
51published for dumb transports. `git repack` does this
52by default.
53
54objects/info/alternates::
55This file records absolute filesystem paths of alternate
56object stores that this object store borrows objects
57from, one pathname per line.
58
59refs::
60References are stored in subdirectories of this
61directory. The `git prune` command knows to keep
62objects reachable from refs found in this directory and
63its subdirectories.
64
65refs/heads/`name`::
66records tip-of-the-tree commit objects of branch `name`
67
68refs/tags/`name`::
69records any object name (not necessarily a commit
70object, or a tag object that points at a commit object).
71
72HEAD::
73A symlink of the form `refs/heads/'name'` to point at
74the current branch, if exists. It does not mean much if
75the repository is not associated with any working tree
Junio C Hamanoe663a7a2006-01-25 12:37:2876(i.e. a 'bare' repository), but a valid git repository
Junio C Hamano1a4e8412005-12-27 08:17:2377*must* have such a symlink here. It is legal if the
78named branch 'name' does not (yet) exist.
79
80branches::
81A slightly deprecated way to store shorthands to be used
82to specify URL to `git fetch`, `git pull` and `git push`
83commands is to store a file in `branches/'name'` and
84give 'name' to these commands in place of 'repository'
85argument.
86
87hooks::
88Hooks are customization scripts used by various git
89commands. A handful of sample hooks are installed when
90`git init-db` is run, but all of them are disabled by
91default. To enable, they need to be made executable.
Junio C Hamano818f7d62006-03-26 01:49:3092Read link:hooks.html[hooks] for more details about
93each hook.
Junio C Hamano1a4e8412005-12-27 08:17:2394
95index::
96The current index file for the repository. It is
Junio C Hamanoe663a7a2006-01-25 12:37:2897usually not found in a bare repository.
Junio C Hamano1a4e8412005-12-27 08:17:2398
99info::
100Additional information about the repository is recorded
101in this directory.
102
103info/refs::
104This file is to help dumb transports to discover what
105refs are available in this repository. Whenever you
106create/delete a new branch or a new tag, `git
107update-server-info` should be run to keep this file
108up-to-date if the repository is published for dumb
109transports. The `git-receive-pack` command, which is
110run on a remote repository when you `git push` into it,
Junio C Hamano235a91e2006-01-07 01:13:58111runs `hooks/update` hook to help you achieve this.
Junio C Hamano1a4e8412005-12-27 08:17:23112
113info/grafts::
114This file records fake commit ancestry information, to
115pretend the set of parents a commit has is different
116from how the commit was actually created. One record
117per line describes a commit and its fake parents by
118listing their 40-byte hexadecimal object names separated
119by a space and terminated by a newline.
120
121info/exclude::
122This file, by convention among Porcelains, stores the
123exclude pattern list. `git status` looks at it, but
124otherwise it is not looked at by any of the core git
125commands.
126
127remotes::
128Stores shorthands to be used to give URL and default
129refnames to interact with remote repository to `git
130fetch`, `git pull` and `git push` commands.