6 git-init-db - Creates an empty git repository
11 'git-init-db' [--template=<template_directory>] [--shared]
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`.
21 Specify that the git repository is to be shared amongst several users.
26 This command creates an empty git repository - basically a `.git` directory
27 with subdirectories for `objects`, `refs/heads`, `refs/tags`, and
29 An initial `HEAD` file that references the HEAD of the master branch
32 If `--template=<template_directory>` is specified, `<template_directory>`
33 is used as the source of the template files rather than the default.
34 The template files include some directory structure, some suggested
35 "exclude patterns", and copies of non-executing "hook" files. The
36 suggested patterns and hook files are all modifiable and extensible.
38 If the `$GIT_DIR` environment variable is set then it specifies a path
39 to use instead of `./.git` for the base of the repository.
41 If the object storage directory is specified via the `$GIT_OBJECT_DIRECTORY`
42 environment variable then the sha1 directories are created underneath -
43 otherwise the default `$GIT_DIR/objects` directory is used.
45 A shared repository allows users belonging to the same group to push into that
46 repository. When specifying `--shared` the config variable "core.sharedRepository"
47 is 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).
50 Running `git-init-db` in an existing repository is safe. It will not overwrite
51 things that are already there. The primary reason for rerunning `git-init-db`
52 is to pick up newly added templates.
59 Start a new git repository for an existing code base::
62 $ cd /path/to/my/codebase
67 <1> prepare /path/to/my/codebase/.git directory
68 <2> add all existing file to the index
73 Written by Linus Torvalds <torvalds@osdl.org>
77 Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
81 Part of the gitlink:git[7] suite