1GITREPOSITORY-LAYOU(5)            Git Manual            GITREPOSITORY-LAYOU(5)
2
3
4

NAME

6       gitrepository-layout - Git Repository Layout
7

SYNOPSIS

9       $GIT_DIR/*
10

DESCRIPTION

12       A Git repository comes in two different flavours:
13
14       ·   a .git directory at the root of the working tree;
15
16       ·   a <project>.git directory that is a bare repository (i.e. without
17           its own working tree), that is typically used for exchanging
18           histories with others by pushing into it and fetching from it.
19
20       Note: Also you can have a plain text file .git at the root of your
21       working tree, containing gitdir: <path> to point at the real directory
22       that has the repository. This mechanism is often used for a working
23       tree of a submodule checkout, to allow you in the containing
24       superproject to git checkout a branch that does not have the submodule.
25       The checkout has to remove the entire submodule working tree, without
26       losing the submodule repository.
27
28       These things may exist in a Git repository.
29
30       objects
31           Object store associated with this repository. Usually an object
32           store is self sufficient (i.e. all the objects that are referred to
33           by an object found in it are also found in it), but there are a few
34           ways to violate it.
35
36            1. You could have an incomplete but locally usable repository by
37               creating a shallow clone. See git-clone(1).
38
39            2. You could be using the objects/info/alternates or
40               $GIT_ALTERNATE_OBJECT_DIRECTORIES mechanisms to borrow objects
41               from other object stores. A repository with this kind of
42               incomplete object store is not suitable to be published for use
43               with dumb transports but otherwise is OK as long as
44               objects/info/alternates points at the object stores it borrows
45               from.
46
47       objects/[0-9a-f][0-9a-f]
48           A newly created object is stored in its own file. The objects are
49           splayed over 256 subdirectories using the first two characters of
50           the sha1 object name to keep the number of directory entries in
51           objects itself to a manageable number. Objects found here are often
52           called unpacked (or loose) objects.
53
54       objects/pack
55           Packs (files that store many object in compressed form, along with
56           index files to allow them to be randomly accessed) are found in
57           this directory.
58
59       objects/info
60           Additional information about the object store is recorded in this
61           directory.
62
63       objects/info/packs
64           This file is to help dumb transports discover what packs are
65           available in this object store. Whenever a pack is added or
66           removed, git update-server-info should be run to keep this file
67           up-to-date if the repository is published for dumb transports.  git
68           repack does this by default.
69
70       objects/info/alternates
71           This file records paths to alternate object stores that this object
72           store borrows objects from, one pathname per line. Note that not
73           only native Git tools use it locally, but the HTTP fetcher also
74           tries to use it remotely; this will usually work if you have
75           relative paths (relative to the object database, not to the
76           repository!) in your alternates file, but it will not work if you
77           use absolute paths unless the absolute path in filesystem and web
78           URL is the same. See also objects/info/http-alternates.
79
80       objects/info/http-alternates
81           This file records URLs to alternate object stores that this object
82           store borrows objects from, to be used when the repository is
83           fetched over HTTP.
84
85       refs
86           References are stored in subdirectories of this directory. The git
87           prune command knows to preserve objects reachable from refs found
88           in this directory and its subdirectories.
89
90       refs/heads/name
91           records tip-of-the-tree commit objects of branch name
92
93       refs/tags/name
94           records any object name (not necessarily a commit object, or a tag
95           object that points at a commit object).
96
97       refs/remotes/name
98           records tip-of-the-tree commit objects of branches copied from a
99           remote repository.
100
101       refs/replace/<obj-sha1>
102           records the SHA-1 of the object that replaces <obj-sha1>. This is
103           similar to info/grafts and is internally used and maintained by
104           git-replace(1). Such refs can be exchanged between repositories
105           while grafts are not.
106
107       packed-refs
108           records the same information as refs/heads/, refs/tags/, and
109           friends record in a more efficient way. See git-pack-refs(1).
110
111       HEAD
112           A symref (see glossary) to the refs/heads/ namespace describing the
113           currently active branch. It does not mean much if the repository is
114           not associated with any working tree (i.e. a bare repository), but
115           a valid Git repository must have the HEAD file; some porcelains may
116           use it to guess the designated "default" branch of the repository
117           (usually master). It is legal if the named branch name does not
118           (yet) exist. In some legacy setups, it is a symbolic link instead
119           of a symref that points at the current branch.
120
121           HEAD can also record a specific commit directly, instead of being a
122           symref to point at the current branch. Such a state is often called
123           detached HEAD.  See git-checkout(1) for details.
124
125       branches
126           A slightly deprecated way to store shorthands to be used to specify
127           a URL to git fetch, git pull and git push. A file can be stored as
128           branches/<name> and then name can be given to these commands in
129           place of repository argument. See the REMOTES section in git-
130           fetch(1) for details. This mechanism is legacy and not likely to be
131           found in modern repositories.
132
133       hooks
134           Hooks are customization scripts used by various Git commands. A
135           handful of sample hooks are installed when git init is run, but all
136           of them are disabled by default. To enable, the .sample suffix has
137           to be removed from the filename by renaming. Read githooks(5) for
138           more details about each hook.
139
140       index
141           The current index file for the repository. It is usually not found
142           in a bare repository.
143
144       info
145           Additional information about the repository is recorded in this
146           directory.
147
148       info/refs
149           This file helps dumb transports discover what refs are available in
150           this repository. If the repository is published for dumb
151           transports, this file should be regenerated by git
152           update-server-info every time a tag or branch is created or
153           modified. This is normally done from the hooks/update hook, which
154           is run by the git-receive-pack command when you git push into the
155           repository.
156
157       info/grafts
158           This file records fake commit ancestry information, to pretend the
159           set of parents a commit has is different from how the commit was
160           actually created. One record per line describes a commit and its
161           fake parents by listing their 40-byte hexadecimal object names
162           separated by a space and terminated by a newline.
163
164       info/exclude
165           This file, by convention among Porcelains, stores the exclude
166           pattern list.  .gitignore is the per-directory ignore file.  git
167           status, git add, git rm and git clean look at it but the core Git
168           commands do not look at it. See also: gitignore(5).
169
170       info/sparse-checkout
171           This file stores sparse checkout patterns. See also: git-read-
172           tree(1).
173
174       remotes
175           Stores shorthands for URL and default refnames for use when
176           interacting with remote repositories via git fetch, git pull and
177           git push commands. See the REMOTES section in git-fetch(1) for
178           details. This mechanism is legacy and not likely to be found in
179           modern repositories.
180
181       logs
182           Records of changes made to refs are stored in this directory. See
183           git-update-ref(1) for more information.
184
185       logs/refs/heads/name
186           Records all changes made to the branch tip named name.
187
188       logs/refs/tags/name
189           Records all changes made to the tag named name.
190
191       shallow
192           This is similar to info/grafts but is internally used and
193           maintained by shallow clone mechanism. See --depth option to git-
194           clone(1) and git-fetch(1).
195
196       modules
197           Contains the git-repositories of the submodules.
198

SEE ALSO

200       git-init(1), git-clone(1), git-fetch(1), git-pack-refs(1), git-gc(1),
201       git-checkout(1), gitglossary(7), The Git User’s Manual[1]
202

GIT

204       Part of the git(1) suite.
205

NOTES

207        1. The Git User’s Manual
208           file:///usr/share/doc/git-1.8.3.1/user-manual.html
209
210
211
212Git 1.8.3.1                       11/19/2018            GITREPOSITORY-LAYOU(5)
Impressum