blob: ea4d849aa3a1d48b83a6df24299155b4171d6315 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-init-db(1)
2==============
3
4NAME
5----
6git-init-db - Creates an empty git repository
7
8
9SYNOPSIS
10--------
Junio C Hamano235a91e2006-01-07 01:13:5811'git-init-db' [--template=<template_directory>] [--shared]
Junio C Hamano1a4e8412005-12-27 08:17:2312
13
14OPTIONS
15-------
16--template=<template_directory>::
17Provide the directory in from which templates will be used.
18
Junio C Hamano235a91e2006-01-07 01:13:5819--shared::
20Specify that the git repository is to be shared amongst several users.
21
Junio C Hamano1a4e8412005-12-27 08:17:2322
23DESCRIPTION
24-----------
25This simply creates an empty git repository - basically a `.git` directory
26and `.git/object/??/`, `.git/refs/heads` and `.git/refs/tags` directories,
27and links `.git/HEAD` symbolically to `.git/refs/heads/master`.
28
29If the `$GIT_DIR` environment variable is set then it specifies a path
30to use instead of `./.git` for the base of the repository.
31
32If the object storage directory is specified via the `$GIT_OBJECT_DIRECTORY`
33environment variable then the sha1 directories are created underneath -
34otherwise the default `$GIT_DIR/objects` directory is used.
35
Junio C Hamano235a91e2006-01-07 01:13:5836A shared repository allows users belonging to the same group to push into that
37repository. When specifying `--shared` the config variable "core.sharedRepository"
38is 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
42Running `git-init-db` in an existing repository is safe. It will not overwrite
43things that are already there. The primary reason for rerunning `git-init-db`
44is to pick up newly added templates.
45
Junio C Hamano1a4e8412005-12-27 08:17:2346
47
48EXAMPLES
49--------
50
51Start 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
63Author
64------
65Written by Linus Torvalds <torvalds@osdl.org>
66
67Documentation
68--------------
69Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
70
71GIT
72---
73Part of the gitlink:git[7] suite
74