Skip to content

Commit 9d379f4

Browse files
pcloudsgitster
authored andcommitted
git-init.txt: move description section up
It's more or less standard that synopsis is followed by description, then options. This is not just a clean move though: - The paragraphs are realigned a bit - The text mentioning git-init-db is dropped. init-db is deprecated, no need to confuse new users Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent af4c62a commit 9d379f4

File tree

1 file changed

+20
-26
lines changed

1 file changed

+20
-26
lines changed

Documentation/git-init.txt

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,26 @@ SYNOPSIS
1111
'git init' [-q | --quiet] [--bare] [--template=<template_directory>] [--shared[=<permissions>]] [directory]
1212

1313

14+
DESCRIPTION
15+
-----------
16+
17+
This command creates an empty git repository - basically a `.git`
18+
directory with subdirectories for `objects`, `refs/heads`,
19+
`refs/tags`, and template files. An initial `HEAD` file that
20+
references the HEAD of the master branch is also created.
21+
22+
If the `$GIT_DIR` environment variable is set then it specifies a path
23+
to use instead of `./.git` for the base of the repository.
24+
25+
If the object storage directory is specified via the
26+
`$GIT_OBJECT_DIRECTORY` environment variable then the sha1 directories
27+
are created underneath - otherwise the default `$GIT_DIR/objects`
28+
directory is used.
29+
30+
Running 'git init' in an existing repository is safe. It will not
31+
overwrite things that are already there. The primary reason for
32+
rerunning 'git init' is to pick up newly added templates.
33+
1434
OPTIONS
1535
-------
1636

@@ -74,32 +94,6 @@ line, the command is run inside the directory (possibly after creating it).
7494
--
7595

7696

77-
DESCRIPTION
78-
-----------
79-
This command creates an empty git repository - basically a `.git` directory
80-
with subdirectories for `objects`, `refs/heads`, `refs/tags`, and
81-
template files.
82-
An initial `HEAD` file that references the HEAD of the master branch
83-
is also created.
84-
85-
If the `$GIT_DIR` environment variable is set then it specifies a path
86-
to use instead of `./.git` for the base of the repository.
87-
88-
If the object storage directory is specified via the `$GIT_OBJECT_DIRECTORY`
89-
environment variable then the sha1 directories are created underneath -
90-
otherwise the default `$GIT_DIR/objects` directory is used.
91-
92-
Running 'git init' in an existing repository is safe. It will not overwrite
93-
things that are already there. The primary reason for rerunning 'git init'
94-
is to pick up newly added templates.
95-
96-
Note that 'git init' is the same as 'git init-db'. The command
97-
was primarily meant to initialize the object database, but over
98-
time it has become responsible for setting up the other aspects
99-
of the repository, such as installing the default hooks and
100-
setting the configuration variables. The old name is retained
101-
for backward compatibility reasons.
102-
10397
TEMPLATE DIRECTORY
10498
------------------
10599

0 commit comments

Comments
 (0)