Documentation / git-init-db.txton commit Merge branch 'master' into next (ab1b3af)
   1git-init-db(1)
   2==============
   3
   4NAME
   5----
   6git-init-db - Creates an empty git repository
   7
   8
   9SYNOPSIS
  10--------
  11'git-init-db' [--template=<template_directory>] [--shared]
  12
  13
  14OPTIONS
  15-------
  16--template=<template_directory>::
  17        Provide the directory from which templates will be used.
  18        The default template directory is `/usr/share/git-core/templates`.
  19
  20--shared::
  21        Specify that the git repository is to be shared amongst several users.
  22
  23
  24DESCRIPTION
  25-----------
  26This command creates an empty git repository - basically a `.git` directory
  27with subdirectories for `objects`, `refs/heads`, `refs/tags`, and
  28templated files.
  29An initial `HEAD` file that references the HEAD of the master branch
  30is also created.
  31
  32If `--template=<template_directory>` is specified, `<template_directory>`
  33is used as the source of the template files rather than the default.
  34The template files include some directory structure, some suggested
  35"exclude patterns", and copies of non-executing "hook" files.  The
  36suggested patterns and hook files are all modifiable and extensible.
  37
  38If the `$GIT_DIR` environment variable is set then it specifies a path
  39to use instead of `./.git` for the base of the repository.
  40
  41If the object storage directory is specified via the `$GIT_OBJECT_DIRECTORY`
  42environment variable then the sha1 directories are created underneath -
  43otherwise the default `$GIT_DIR/objects` directory is used.
  44
  45A shared repository allows users belonging to the same group to push into that
  46repository. When specifying `--shared` the config variable "core.sharedRepository" 
  47is set to 'true' so that directories under `$GIT_DIR` are made group writable
  48(and g+sx, since the git group may be not the primary group of all users).
  49
  50Running `git-init-db` in an existing repository is safe. It will not overwrite
  51things that are already there. The primary reason for rerunning `git-init-db`
  52is to pick up newly added templates.
  53
  54
  55
  56EXAMPLES
  57--------
  58
  59Start a new git repository for an existing code base::
  60+
  61----------------
  62$ cd /path/to/my/codebase
  63$ git-init-db   <1>
  64$ git-add .     <2>
  65----------------
  66+
  67<1> prepare /path/to/my/codebase/.git directory
  68<2> add all existing file to the index
  69
  70
  71Author
  72------
  73Written by Linus Torvalds <torvalds@osdl.org>
  74
  75Documentation
  76--------------
  77Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
  78
  79GIT
  80---
  81Part of the gitlink:git[7] suite
  82