6d8c58ed205cb051cf2a1f8f495d37405cabd398
   1git repository layout
   2=====================
   3
   4You may find these things in your git repository (`.git`
   5directory for a repository associated with your working tree, or
   6`'project'.git` directory for a public 'bare' repository).
   7
   8objects::
   9        Object store associated with this repository.  Usually
  10        an object store is self sufficient (i.e. all the objects
  11        that are referred to by an object found in it are also
  12        found in it), but there are couple of ways to violate
  13        it.
  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
  24of incomplete object store is not suitable to be published for
  25use 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]::
  30        Traditionally, each object is stored in its own file.
  31        They are split into 256 subdirectories using the first
  32        two letters from its object name to keep the number of
  33        directory entries `objects` directory itself needs to
  34        hold.  Objects found here are often called 'unpacked'
  35        objects.
  36
  37objects/pack::
  38        Packs (files that store many object in compressed form,
  39        along with index files to allow them to be randomly
  40        accessed) are found in this directory.
  41
  42objects/info::
  43        Additional information about the object store is
  44        recorded in this directory.
  45
  46objects/info/packs::
  47        This file is to help dumb transports discover what packs
  48        are available in this object store.  Whenever a pack is
  49        added or removed, `git update-server-info` should be run
  50        to keep this file up-to-date if the repository is
  51        published for dumb transports.  `git repack` does this
  52        by default.
  53
  54objects/info/alternates::
  55        This file records absolute filesystem paths of alternate
  56        object stores that this object store borrows objects
  57        from, one pathname per line.
  58
  59refs::
  60        References are stored in subdirectories of this
  61        directory.  The `git prune` command knows to keep
  62        objects reachable from refs found in this directory and
  63        its subdirectories.
  64
  65refs/heads/`name`::
  66        records tip-of-the-tree commit objects of branch `name`
  67
  68refs/tags/`name`::
  69        records any object name (not necessarily a commit
  70        object, or a tag object that points at a commit object).
  71
  72HEAD::
  73        A symref (see glossary) to the `refs/heads/` namespace
  74        describing the currently active branch.  It does not mean
  75        much if the repository is not associated with any working tree
  76        (i.e. a 'bare' repository), but a valid git repository
  77        *must* have the HEAD file; some porcelains may use it to
  78        guess the designated "default" branch of the repository
  79        (usually 'master').  It is legal if the named branch
  80        'name' does not (yet) exist.  In some legacy setups, it is
  81        a symbolic link instead of a symref that points at the current
  82        branch.
  83
  84branches::
  85        A slightly deprecated way to store shorthands to be used
  86        to specify URL to `git fetch`, `git pull` and `git push`
  87        commands is to store a file in `branches/'name'` and
  88        give 'name' to these commands in place of 'repository'
  89        argument.
  90
  91hooks::
  92        Hooks are customization scripts used by various git
  93        commands.  A handful of sample hooks are installed when
  94        `git init-db` is run, but all of them are disabled by
  95        default.  To enable, they need to be made executable.
  96        Read link:hooks.html[hooks] for more details about
  97        each hook.
  98
  99index::
 100        The current index file for the repository.  It is
 101        usually not found in a bare repository.
 102
 103info::
 104        Additional information about the repository is recorded
 105        in this directory.
 106
 107info/refs::
 108        This file is to help dumb transports to discover what
 109        refs are available in this repository.  Whenever you
 110        create/delete a new branch or a new tag, `git
 111        update-server-info` should be run to keep this file
 112        up-to-date if the repository is published for dumb
 113        transports.  The `git-receive-pack` command, which is
 114        run on a remote repository when you `git push` into it,
 115        runs `hooks/update` hook to help you achieve this.
 116
 117info/grafts::
 118        This file records fake commit ancestry information, to
 119        pretend the set of parents a commit has is different
 120        from how the commit was actually created.  One record
 121        per line describes a commit and its fake parents by
 122        listing their 40-byte hexadecimal object names separated
 123        by a space and terminated by a newline.
 124
 125info/exclude::
 126        This file, by convention among Porcelains, stores the
 127        exclude pattern list. `.gitignore` is the per-directory
 128        ignore file.  `git status`, `git add`, `git rm` and `git
 129        clean` look at it but the core git commands do not look
 130        at it.  See also: gitlink:git-ls-files[1] `--exclude-from`
 131        and `--exclude-per-directory`.
 132
 133remotes::
 134        Stores shorthands to be used to give URL and default
 135        refnames to interact with remote repository to `git
 136        fetch`, `git pull` and `git push` commands.
 137
 138logs::
 139        Records of changes made to refs are stored in this
 140        directory.  See the documentation on git-update-ref
 141        for more information.
 142
 143logs/refs/heads/`name`::
 144        Records all changes made to the branch tip named `name`.
 145
 146logs/refs/tags/`name`::
 147        Records all changes made to the tag named `name`.