@@ -43,7 +43,7 @@ OPTIONS
43
43
-q::
44
44
--quiet::
45
45
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.
47
47
48
48
--bare::
49
49
@@ -57,12 +57,12 @@ DIRECTORY" section below.)
57
57
58
58
--separate-git-dir=<git dir>::
59
59
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.
66
66
67
67
--shared[=(false|true|umask|group|all|world|everybody|0xxx)]::
68
68
@@ -72,60 +72,65 @@ repository. When specified, the config variable "core.sharedRepository" is
72
72
set so that files and directories under `$GIT_DIR` are created with the
73
73
requested permissions. When not specified, Git will use permissions reported
74
74
by umask(2).
75
-
75
+ +
76
76
The option can have the following values, defaulting to 'group' if no value
77
77
is given:
78
+ +
79
+ --
80
+ 'umask' (or 'false')::
78
81
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.
81
84
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')::
89
86
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.
92
93
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')::
99
95
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
101
108
in shared repositories, so that you cannot force a non fast-forwarding push
102
109
into it.
103
110
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 .
106
113
107
114
--
108
115
109
-
110
116
TEMPLATE DIRECTORY
111
117
------------------
112
118
113
119
The template directory contains files and directories that will be copied to
114
120
the `$GIT_DIR` after it is created.
115
121
116
- The template directory used will (in order):
122
+ The template directory will be one of the following (in order):
117
123
118
- - The argument given with the `--template` option.
124
+ - the argument given with the `--template` option;
119
125
120
- - The contents of the `$GIT_TEMPLATE_DIR` environment variable.
126
+ - the contents of the `$GIT_TEMPLATE_DIR` environment variable;
121
127
122
- - The `init.templatedir` configuration variable.
128
+ - the `init.templatedir` configuration variable; or
123
129
124
- - The default template directory: `/usr/share/git-core/templates`.
130
+ - the default template directory: `/usr/share/git-core/templates`.
125
131
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]).
129
134
130
135
EXAMPLES
131
136
--------
@@ -136,10 +141,12 @@ Start a new Git repository for an existing code base::
136
141
$ cd /path/to/my/codebase
137
142
$ git init <1>
138
143
$ git add . <2>
144
+ $ git commit <3>
139
145
----------------
140
146
+
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.
143
150
144
151
GIT
145
152
---
0 commit comments