Skip to content

Commit d5dc6a7

Browse files
jonasJunio C Hamano
authored andcommitted
Update git-init-db(1) and documentation of core.sharedRepository
Combine option descriptions in git-init-db(1). Reflect the changes to additionally allow all users to read the created git repository. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 6c8d06a commit d5dc6a7

File tree

2 files changed

+41
-19
lines changed

2 files changed

+41
-19
lines changed

Documentation/config.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,12 @@ core.repositoryFormatVersion::
8383
version.
8484

8585
core.sharedRepository::
86-
If true, the repository is made shareable between several users
87-
in a group (making sure all the files and objects are group-writable).
88-
See gitlink:git-init-db[1]. False by default.
86+
When 'group' (or 'true'), the repository is made shareable between
87+
several users in a group (making sure all the files and objects are
88+
group-writable). When 'all' (or 'world' or 'everybody'), the
89+
repository will be readable by all users, additionally to being
90+
group-shareable. When 'umask' (or 'false'), git will use permissions
91+
reported by umask(2). See gitlink:git-init-db[1]. False by default.
8992

9093
core.warnAmbiguousRefs::
9194
If true, git will warn you if the ref name you passed it is ambiguous

Documentation/git-init-db.txt

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,47 @@ git-init-db - Creates an empty git repository
88

99
SYNOPSIS
1010
--------
11-
'git-init-db' [--template=<template_directory>] [--shared]
11+
'git-init-db' [--template=<template_directory>] [--shared[=<permissions>]]
1212

1313

1414
OPTIONS
1515
-------
16+
17+
--
18+
1619
--template=<template_directory>::
17-
Provide the directory from which templates will be used.
18-
The default template directory is `/usr/share/git-core/templates`.
1920

20-
--shared::
21-
Specify that the git repository is to be shared amongst several users.
21+
Provide the directory from which templates will be used. The default template
22+
directory is `/usr/share/git-core/templates`.
23+
24+
When specified, `<template_directory>` is used as the source of the template
25+
files rather than the default. The template files include some directory
26+
structure, some suggested "exclude patterns", and copies of non-executing
27+
"hook" files. The suggested patterns and hook files are all modifiable and
28+
extensible.
29+
30+
--shared[={false|true|umask|group|all|world|everybody}]::
31+
32+
Specify that the git repository is to be shared amongst several users. This
33+
allows users belonging to the same group to push into that
34+
repository. When specified, the config variable "core.sharedRepository" is
35+
set so that files and directories under `$GIT_DIR` are created with the
36+
requested permissions. When not specified, git will use permissions reported
37+
by umask(2).
38+
39+
The option can have the following values, defaulting to 'group' if no value
40+
is given:
41+
42+
- 'umask' (or 'false'): Use permissions reported by umask(2). The default,
43+
when `--shared` is not specified.
44+
45+
- 'group' (or 'true'): Make the repository group-writable, (and g+sx, since
46+
the git group may be not the primary group of all users).
47+
48+
- 'all' (or 'world' or 'everybody'): Same as 'group', but make the repository
49+
readable by all users.
50+
51+
--
2252

2353

2454
DESCRIPTION
@@ -29,24 +59,13 @@ template files.
2959
An initial `HEAD` file that references the HEAD of the master branch
3060
is also created.
3161

32-
If `--template=<template_directory>` is specified, `<template_directory>`
33-
is used as the source of the template files rather than the default.
34-
The template files include some directory structure, some suggested
35-
"exclude patterns", and copies of non-executing "hook" files. The
36-
suggested patterns and hook files are all modifiable and extensible.
37-
3862
If the `$GIT_DIR` environment variable is set then it specifies a path
3963
to use instead of `./.git` for the base of the repository.
4064

4165
If the object storage directory is specified via the `$GIT_OBJECT_DIRECTORY`
4266
environment variable then the sha1 directories are created underneath -
4367
otherwise the default `$GIT_DIR/objects` directory is used.
4468

45-
A shared repository allows users belonging to the same group to push into that
46-
repository. When specifying `--shared` the config variable "core.sharedRepository"
47-
is set to 'true' so that directories under `$GIT_DIR` are made group writable
48-
(and g+sx, since the git group may be not the primary group of all users).
49-
5069
Running `git-init-db` in an existing repository is safe. It will not overwrite
5170
things that are already there. The primary reason for rerunning `git-init-db`
5271
is to pick up newly added templates.

0 commit comments

Comments
 (0)