blob: 1f19bf86dd1dd031ac45b536905c092f550ef9f0 [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.
92
93index::
94The current index file for the repository. It is
Junio C Hamanoe663a7a2006-01-25 12:37:2895usually not found in a bare repository.
Junio C Hamano1a4e8412005-12-27 08:17:2396
97info::
98Additional information about the repository is recorded
99in this directory.
100
101info/refs::
102This file is to help dumb transports to discover what
103refs are available in this repository. Whenever you
104create/delete a new branch or a new tag, `git
105update-server-info` should be run to keep this file
106up-to-date if the repository is published for dumb
107transports. The `git-receive-pack` command, which is
108run on a remote repository when you `git push` into it,
Junio C Hamano235a91e2006-01-07 01:13:58109runs `hooks/update` hook to help you achieve this.
Junio C Hamano1a4e8412005-12-27 08:17:23110
111info/grafts::
112This file records fake commit ancestry information, to
113pretend the set of parents a commit has is different
114from how the commit was actually created. One record
115per line describes a commit and its fake parents by
116listing their 40-byte hexadecimal object names separated
117by a space and terminated by a newline.
118
119info/exclude::
120This file, by convention among Porcelains, stores the
121exclude pattern list. `git status` looks at it, but
122otherwise it is not looked at by any of the core git
123commands.
124
125remotes::
126Stores shorthands to be used to give URL and default
127refnames to interact with remote repository to `git
128fetch`, `git pull` and `git push` commands.