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