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 in from which templates will be used.
20 Specify that the git repository is to be shared amongst several users.
25 This simply creates an empty git repository - basically a `.git` directory
26 and `.git/object/??/`, `.git/refs/heads` and `.git/refs/tags` directories,
27 and links `.git/HEAD` symbolically to `.git/refs/heads/master`.
29 If the `$GIT_DIR` environment variable is set then it specifies a path
30 to use instead of `./.git` for the base of the repository.
32 If the object storage directory is specified via the `$GIT_OBJECT_DIRECTORY`
33 environment variable then the sha1 directories are created underneath -
34 otherwise the default `$GIT_DIR/objects` directory is used.
36 A shared repository allows users belonging to the same group to push into that
37 repository. When specifying `--shared` the config variable "core.sharedRepository"
38 is set to 'true' so that directories under `$GIT_DIR` are made group writable
39 (and g+sx, since the git group may be not the primary group of all users).
42 Running `git-init-db` in an existing repository is safe. It will not overwrite
43 things that are already there. The primary reason for rerunning `git-init-db`
44 is to pick up newly added templates.
51 Start a new git repository for an existing code base::
54 $ cd /path/to/my/codebase
58 <1> prepare /path/to/my/codebase/.git directory
59 <2> add all existing file to the index
65 Written by Linus Torvalds <torvalds@osdl.org>
69 Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
73 Part of the gitlink:git[7] suite