Autogenerated HTML docs for v1.2.2-gc55f
[git.git] / git-init-db.txt
1 git-init-db(1)
2 ==============
3
4 NAME
5 ----
6 git-init-db - Creates an empty git repository
7
8
9 SYNOPSIS
10 --------
11 'git-init-db' [--template=<template_directory>] [--shared]
12
13
14 OPTIONS
15 -------
16 --template=<template_directory>::
17         Provide the directory in from which templates will be used.
18
19 --shared::
20         Specify that the git repository is to be shared amongst several users.
21
22
23 DESCRIPTION
24 -----------
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`.
28
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.
31
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.
35
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).
40
41
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.
45
46
47
48 EXAMPLES
49 --------
50
51 Start a new git repository for an existing code base::
52 +
53 ----------------
54 $ cd /path/to/my/codebase
55 $ git-init-db <1>
56 $ git-add . <2>
57
58 <1> prepare /path/to/my/codebase/.git directory
59 <2> add all existing file to the index
60 ----------------
61
62
63 Author
64 ------
65 Written by Linus Torvalds <torvalds@osdl.org>
66
67 Documentation
68 --------------
69 Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
70
71 GIT
72 ---
73 Part of the gitlink:git[7] suite
74