Skip to content

Commit 4645b01

Browse files
committed
Merge branch 'la/init-doc'
* la/init-doc: Documentation: git-init: flesh out example Documentation: git-init: template directory: reword and cross-reference Documentation: git-init: reword parenthetical statements Documentation: git-init: --separate-git-dir: clarify Documentation: git-init: template directory: reword Documentation: git-init: list items facelift Documentation: git-init: typographical fixes
2 parents 753aaf3 + 64de2e1 commit 4645b01

File tree

1 file changed

+46
-39
lines changed

1 file changed

+46
-39
lines changed

Documentation/git-init.txt

Lines changed: 46 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ OPTIONS
4343
-q::
4444
--quiet::
4545

46-
Only print error and warning messages, all other output will be suppressed.
46+
Only print error and warning messages; all other output will be suppressed.
4747

4848
--bare::
4949

@@ -57,12 +57,12 @@ DIRECTORY" section below.)
5757

5858
--separate-git-dir=<git dir>::
5959

60-
Instead of initializing the repository where it is supposed to be,
61-
place a filesytem-agnostic Git symbolic link there, pointing to the
62-
specified path, and initialize a Git repository at the path. The
63-
result is Git repository can be separated from working tree. If this
64-
is reinitialization, the repository will be moved to the specified
65-
path.
60+
Instead of initializing the repository as a directory to either `$GIT_DIR` or
61+
`./.git/`, create a text file there containing the path to the actual
62+
repository. This file acts as filesystem-agnostic Git symbolic link to the
63+
repository.
64+
+
65+
If this is reinitialization, the repository will be moved to the specified path.
6666

6767
--shared[=(false|true|umask|group|all|world|everybody|0xxx)]::
6868

@@ -72,60 +72,65 @@ repository. When specified, the config variable "core.sharedRepository" is
7272
set so that files and directories under `$GIT_DIR` are created with the
7373
requested permissions. When not specified, Git will use permissions reported
7474
by umask(2).
75-
75+
+
7676
The option can have the following values, defaulting to 'group' if no value
7777
is given:
78+
+
79+
--
80+
'umask' (or 'false')::
7881

79-
- 'umask' (or 'false'): Use permissions reported by umask(2). The default,
80-
when `--shared` is not specified.
82+
Use permissions reported by umask(2). The default, when `--shared` is not
83+
specified.
8184

82-
- 'group' (or 'true'): Make the repository group-writable, (and g+sx, since
83-
the git group may be not the primary group of all users).
84-
This is used to loosen the permissions of an otherwise safe umask(2) value.
85-
Note that the umask still applies to the other permission bits (e.g. if
86-
umask is '0022', using 'group' will not remove read privileges from other
87-
(non-group) users). See '0xxx' for how to exactly specify the repository
88-
permissions.
85+
'group' (or 'true')::
8986

90-
- 'all' (or 'world' or 'everybody'): Same as 'group', but make the repository
91-
readable by all users.
87+
Make the repository group-writable, (and g+sx, since the git group may be not
88+
the primary group of all users). This is used to loosen the permissions of an
89+
otherwise safe umask(2) value. Note that the umask still applies to the other
90+
permission bits (e.g. if umask is '0022', using 'group' will not remove read
91+
privileges from other (non-group) users). See '0xxx' for how to exactly specify
92+
the repository permissions.
9293

93-
- '0xxx': '0xxx' is an octal number and each file will have mode '0xxx'.
94-
'0xxx' will override users' umask(2) value (and not only loosen permissions
95-
as 'group' and 'all' does). '0640' will create a repository which is
96-
group-readable, but not group-writable or accessible to others. '0660' will
97-
create a repo that is readable and writable to the current user and group,
98-
but inaccessible to others.
94+
'all' (or 'world' or 'everybody')::
9995

100-
By default, the configuration flag receive.denyNonFastForwards is enabled
96+
Same as 'group', but make the repository readable by all users.
97+
98+
'0xxx'::
99+
100+
'0xxx' is an octal number and each file will have mode '0xxx'. '0xxx' will
101+
override users' umask(2) value (and not only loosen permissions as 'group' and
102+
'all' does). '0640' will create a repository which is group-readable, but not
103+
group-writable or accessible to others. '0660' will create a repo that is
104+
readable and writable to the current user and group, but inaccessible to others.
105+
--
106+
107+
By default, the configuration flag `receive.denyNonFastForwards` is enabled
101108
in shared repositories, so that you cannot force a non fast-forwarding push
102109
into it.
103110

104-
If you name a (possibly non-existent) directory at the end of the command
105-
line, the command is run inside the directory (possibly after creating it).
111+
If you provide a 'directory', the command is run inside it. If this directory
112+
does not exist, it will be created.
106113

107114
--
108115

109-
110116
TEMPLATE DIRECTORY
111117
------------------
112118

113119
The template directory contains files and directories that will be copied to
114120
the `$GIT_DIR` after it is created.
115121

116-
The template directory used will (in order):
122+
The template directory will be one of the following (in order):
117123

118-
- The argument given with the `--template` option.
124+
- the argument given with the `--template` option;
119125

120-
- The contents of the `$GIT_TEMPLATE_DIR` environment variable.
126+
- the contents of the `$GIT_TEMPLATE_DIR` environment variable;
121127

122-
- The `init.templatedir` configuration variable.
128+
- the `init.templatedir` configuration variable; or
123129

124-
- The default template directory: `/usr/share/git-core/templates`.
130+
- the default template directory: `/usr/share/git-core/templates`.
125131

126-
The default template directory includes some directory structure, some
127-
suggested "exclude patterns", and copies of sample "hook" files.
128-
The suggested patterns and hook files are all modifiable and extensible.
132+
The default template directory includes some directory structure, suggested
133+
"exclude patterns" (see linkgit:gitignore[5]), and sample hook files (see linkgit:githooks[5]).
129134

130135
EXAMPLES
131136
--------
@@ -136,10 +141,12 @@ Start a new Git repository for an existing code base::
136141
$ cd /path/to/my/codebase
137142
$ git init <1>
138143
$ git add . <2>
144+
$ git commit <3>
139145
----------------
140146
+
141-
<1> prepare /path/to/my/codebase/.git directory
142-
<2> add all existing file to the index
147+
<1> Create a /path/to/my/codebase/.git directory.
148+
<2> Add all existing files to the index.
149+
<3> Record the pristine state as the first commit in the history.
143150

144151
GIT
145152
---

0 commit comments

Comments
 (0)