@@ -9,15 +9,15 @@ git-clone - Clone a repository into a new directory
9
9
SYNOPSIS
10
10
--------
11
11
[verse]
12
- ' git clone' [ --template=<template-directory>]
13
- [-l ] [-s ] [--no-hardlinks] [-q ] [-n ] [--bare] [--mirror]
14
- [-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]
15
- [--dissociate] [--separate-git-dir <git-dir>]
16
- [--depth <depth>] [--[ no-] single-branch] [--no-tags]
17
- [--recurse-submodules[= <pathspec>]] [--[ no-] shallow-submodules]
18
- [--[ no-] remote-submodules] [--jobs <n>] [--sparse] [--[ no-] reject-shallow]
19
- [--filter=<filter> [ --also-filter-submodules]] [--] <repository>
20
- [<directory>]
12
+ ` git clone` [++ --template=++__ <template-directory>__ ]
13
+ [`-l` ] [`-s` ] [` --no-hardlinks` ] [`-q` ] [`-n` ] [` --bare` ] [` --mirror` ]
14
+ [`-o` _ <name>_ ] [`-b` _ <name>_ ] [`-u` _ <upload-pack>_ ] [` --reference` _ <repository>_ ]
15
+ [` --dissociate` ] [` --separate-git-dir` _ <git-dir>_ ]
16
+ [` --depth` _ <depth>_ ] [`--`[` no-`]` single-branch` ] [` --no-tags` ]
17
+ [++ --recurse-submodules++[++=++__ <pathspec>__ ]] [`--`[` no-`]` shallow-submodules` ]
18
+ [`--`[` no-`]` remote-submodules` ] [` --jobs` _ <n>_ ] [` --sparse` ] [`--`[` no-`]` reject-shallow` ]
19
+ [++ --filter=++__ <filter-spec>__] [` --also-filter-submodules` ]] [`--`] _ <repository>_
20
+ [_ <directory>_ ]
21
21
22
22
DESCRIPTION
23
23
-----------
@@ -31,7 +31,7 @@ currently active branch.
31
31
After the clone, a plain `git fetch` without arguments will update
32
32
all the remote-tracking branches, and a `git pull` without
33
33
arguments will in addition merge the remote master branch into the
34
- current master branch, if any (this is untrue when " --single-branch"
34
+ current master branch, if any (this is untrue when ` --single-branch`
35
35
is given; see below).
36
36
37
37
This default configuration is achieved by creating references to
@@ -42,12 +42,12 @@ configuration variables.
42
42
43
43
OPTIONS
44
44
-------
45
- -l ::
46
- --local::
45
+ `-l` ::
46
+ ` --local` ::
47
47
When the repository to clone from is on a local machine,
48
48
this flag bypasses the normal "Git aware" transport
49
49
mechanism and clones the repository by making a copy of
50
- HEAD and everything under objects and refs directories.
50
+ ` HEAD` and everything under objects and refs directories.
51
51
The files under `.git/objects/` directory are hardlinked
52
52
to save space when possible.
53
53
+
@@ -67,14 +67,14 @@ links.
67
67
source repository, similar to running `cp -r src dst` while modifying
68
68
`src`.
69
69
70
- --no-hardlinks::
70
+ ` --no-hardlinks` ::
71
71
Force the cloning process from a repository on a local
72
72
filesystem to copy the files under the `.git/objects`
73
73
directory instead of using hardlinks. This may be desirable
74
74
if you are trying to make a back-up of your repository.
75
75
76
- -s ::
77
- --shared::
76
+ `-s` ::
77
+ ` --shared` ::
78
78
When the repository to clone is on the local machine,
79
79
instead of using hard links, automatically setup
80
80
`.git/objects/info/alternates` to share the objects
@@ -101,7 +101,7 @@ If you want to break the dependency of a repository cloned with `--shared` on
101
101
its source repository, you can simply run `git repack -a` to copy all
102
102
objects from the source repository into a pack in the cloned repository.
103
103
104
- --reference[ -if-able] <repository>::
104
+ ` --reference`[` -if-able`] _ <repository>_ ::
105
105
If the reference _<repository>_ is on the local machine,
106
106
automatically setup `.git/objects/info/alternates` to
107
107
obtain objects from the reference _<repository>_. Using
@@ -115,7 +115,7 @@ objects from the source repository into a pack in the cloned repository.
115
115
*NOTE*: see the NOTE for the `--shared` option, and also the
116
116
`--dissociate` option.
117
117
118
- --dissociate::
118
+ ` --dissociate` ::
119
119
Borrow the objects from reference repositories specified
120
120
with the `--reference` options only to reduce network
121
121
transfer, and stop borrowing from them after a clone is made
@@ -126,43 +126,43 @@ objects from the source repository into a pack in the cloned repository.
126
126
same repository, and this option can be used to stop the
127
127
borrowing.
128
128
129
- -q ::
130
- --quiet::
129
+ `-q` ::
130
+ ` --quiet` ::
131
131
Operate quietly. Progress is not reported to the standard
132
132
error stream.
133
133
134
- -v ::
135
- --verbose::
134
+ `-v` ::
135
+ ` --verbose` ::
136
136
Run verbosely. Does not affect the reporting of progress status
137
137
to the standard error stream.
138
138
139
- --progress::
139
+ ` --progress` ::
140
140
Progress status is reported on the standard error stream
141
141
by default when it is attached to a terminal, unless `--quiet`
142
142
is specified. This flag forces progress status even if the
143
143
standard error stream is not directed to a terminal.
144
144
145
- --server-option=<option>::
145
+ ++ --server-option=++__ <option>__ ::
146
146
Transmit the given string to the server when communicating using
147
147
protocol version 2. The given string must not contain a NUL or LF
148
148
character. The server's handling of server options, including
149
149
unknown ones, is server-specific.
150
- When multiple ` --server-option=<option>` are given, they are all
150
+ When multiple ++ --server-option=++__ <option>__ are given, they are all
151
151
sent to the other side in the order listed on the command line.
152
152
153
- -n ::
154
- --no-checkout::
153
+ `-n` ::
154
+ ` --no-checkout` ::
155
155
No checkout of HEAD is performed after the clone is complete.
156
156
157
- --[ no-] reject-shallow::
157
+ `--`[` no-`]` reject-shallow` ::
158
158
Fail if the source repository is a shallow repository.
159
159
The `clone.rejectShallow` configuration variable can be used to
160
160
specify the default.
161
161
162
- --bare::
162
+ ` --bare` ::
163
163
Make a 'bare' Git repository. That is, instead of
164
164
creating _<directory>_ and placing the administrative
165
- files in ` <directory>/.git`, make the _<directory>_
165
+ files in _ <directory>_` /.git`, make the _<directory>_
166
166
itself the `$GIT_DIR`. This obviously implies the `--no-checkout`
167
167
because there is nowhere to check out the working tree.
168
168
Also the branch heads at the remote are copied directly
@@ -171,62 +171,62 @@ objects from the source repository into a pack in the cloned repository.
171
171
used, neither remote-tracking branches nor the related
172
172
configuration variables are created.
173
173
174
- --sparse::
174
+ ` --sparse` ::
175
175
Employ a sparse-checkout, with only files in the toplevel
176
176
directory initially being present. The
177
177
linkgit:git-sparse-checkout[1] command can be used to grow the
178
178
working directory as needed.
179
179
180
- --filter=<filter-spec>::
180
+ ++ --filter=++__ <filter-spec>__ ::
181
181
Use the partial clone feature and request that the server sends
182
182
a subset of reachable objects according to a given object filter.
183
183
When using `--filter`, the supplied _<filter-spec>_ is used for
184
184
the partial clone filter. For example, `--filter=blob:none` will
185
185
filter out all blobs (file contents) until needed by Git. Also,
186
- ` --filter=blob:limit=<size>` will filter out all blobs of size
186
+ ++ --filter=blob:limit=++__ <size>__ will filter out all blobs of size
187
187
at least _<size>_. For more details on filter specifications, see
188
188
the `--filter` option in linkgit:git-rev-list[1].
189
189
190
- --also-filter-submodules::
190
+ ` --also-filter-submodules` ::
191
191
Also apply the partial clone filter to any submodules in the repository.
192
192
Requires `--filter` and `--recurse-submodules`. This can be turned on by
193
193
default by setting the `clone.filterSubmodules` config option.
194
194
195
- --mirror::
195
+ ` --mirror` ::
196
196
Set up a mirror of the source repository. This implies `--bare`.
197
197
Compared to `--bare`, `--mirror` not only maps local branches of the
198
198
source to local branches of the target, it maps all refs (including
199
199
remote-tracking branches, notes etc.) and sets up a refspec configuration such
200
200
that all these refs are overwritten by a `git remote update` in the
201
201
target repository.
202
202
203
- -o <name>::
204
- --origin <name>::
203
+ `-o` _ <name>_ ::
204
+ ` --origin` _ <name>_ ::
205
205
Instead of using the remote name `origin` to keep track of the upstream
206
206
repository, use _<name>_. Overrides `clone.defaultRemoteName` from the
207
207
config.
208
208
209
- -b <name>::
210
- --branch <name>::
209
+ `-b` _ <name>_ ::
210
+ ` --branch` _ <name>_ ::
211
211
Instead of pointing the newly created HEAD to the branch pointed
212
212
to by the cloned repository's HEAD, point to _<name>_ branch
213
213
instead. In a non-bare repository, this is the branch that will
214
214
be checked out.
215
215
`--branch` can also take tags and detaches the HEAD at that commit
216
216
in the resulting repository.
217
217
218
- -u <upload-pack>::
219
- --upload-pack <upload-pack>::
218
+ `-u` _ <upload-pack>_ ::
219
+ ` --upload-pack` _ <upload-pack>_ ::
220
220
When given, and the repository to clone from is accessed
221
221
via ssh, this specifies a non-default path for the command
222
222
run on the other end.
223
223
224
- --template=<template-directory>::
224
+ ++ --template=++__ <template-directory>__ ::
225
225
Specify the directory from which templates will be used;
226
226
(See the "TEMPLATE DIRECTORY" section of linkgit:git-init[1].)
227
227
228
- -c <key>= <value>::
229
- --config <key>= <value>::
228
+ `-c` __ <key>__++=++__ <value>__ ::
229
+ ` --config` __ <key>__++=++__ <value>__ ::
230
230
Set a configuration variable in the newly-created repository;
231
231
this takes effect immediately after the repository is
232
232
initialized, but before the remote history is fetched or any
@@ -239,25 +239,25 @@ objects from the source repository into a pack in the cloned repository.
239
239
Due to limitations of the current implementation, some configuration
240
240
variables do not take effect until after the initial fetch and checkout.
241
241
Configuration variables known to not take effect are:
242
- ` remote.<name>.mirror` and ` remote.<name>.tagOpt` . Use the
242
+ ++ remote.++__ <name>__++ .mirror++ and ++ remote.++__ <name>__++ .tagOpt++ . Use the
243
243
corresponding `--mirror` and `--no-tags` options instead.
244
244
245
- --depth <depth>::
245
+ ` --depth` _ <depth>_ ::
246
246
Create a 'shallow' clone with a history truncated to the
247
247
specified number of commits. Implies `--single-branch` unless
248
248
`--no-single-branch` is given to fetch the histories near the
249
249
tips of all branches. If you want to clone submodules shallowly,
250
250
also pass `--shallow-submodules`.
251
251
252
- --shallow-since=<date>::
252
+ ++ --shallow-since=++__ <date>__ ::
253
253
Create a shallow clone with a history after the specified time.
254
254
255
- --shallow-exclude=<revision>::
255
+ ++ --shallow-exclude=++__ <revision>__ ::
256
256
Create a shallow clone with a history, excluding commits
257
257
reachable from a specified remote branch or tag. This option
258
258
can be specified multiple times.
259
259
260
- --[ no-] single-branch::
260
+ `--`[` no-`]` single-branch` ::
261
261
Clone only the history leading to the tip of a single branch,
262
262
either specified by the `--branch` option or the primary
263
263
branch remote's `HEAD` points at.
@@ -267,7 +267,7 @@ corresponding `--mirror` and `--no-tags` options instead.
267
267
branch when `--single-branch` clone was made, no remote-tracking
268
268
branch is created.
269
269
270
- --no-tags::
270
+ ` --no-tags` ::
271
271
Don't clone any tags, and set
272
272
`remote.<remote>.tagOpt=--no-tags` in the config, ensuring
273
273
that future `git pull` and `git fetch` operations won't follow
@@ -279,7 +279,7 @@ maintain a branch with no references other than a single cloned
279
279
branch. This is useful e.g. to maintain minimal clones of the default
280
280
branch of some repository for search indexing.
281
281
282
- --recurse-submodules[= <pathspec>]::
282
+ ` --recurse-submodules`[`=`{empty}__ <pathspec>__ ]::
283
283
After the clone is created, initialize and clone submodules
284
284
within based on the provided _<pathspec>_. If no _=<pathspec>_ is
285
285
provided, all submodules are initialized and cloned.
@@ -295,46 +295,46 @@ the clone is finished. This option is ignored if the cloned repository does
295
295
not have a worktree/checkout (i.e. if any of `--no-checkout`/`-n`, `--bare`,
296
296
or `--mirror` is given)
297
297
298
- --[ no-] shallow-submodules::
298
+ `--`[` no-`]` shallow-submodules` ::
299
299
All submodules which are cloned will be shallow with a depth of 1.
300
300
301
- --[ no-] remote-submodules::
301
+ `--`[` no-`]` remote-submodules` ::
302
302
All submodules which are cloned will use the status of the submodule's
303
303
remote-tracking branch to update the submodule, rather than the
304
304
superproject's recorded SHA-1. Equivalent to passing `--remote` to
305
305
`git submodule update`.
306
306
307
- --separate-git-dir=<git-dir>::
307
+ ` --separate-git-dir=`{empty}__ <git-dir>__ ::
308
308
Instead of placing the cloned repository where it is supposed
309
309
to be, place the cloned repository at the specified directory,
310
310
then make a filesystem-agnostic Git symbolic link to there.
311
311
The result is Git repository can be separated from working
312
312
tree.
313
313
314
- --ref-format=<ref-format>::
314
+ ` --ref-format=`{empty}__ <ref-format>__ ::
315
315
316
316
Specify the given ref storage format for the repository. The valid values are:
317
317
+
318
318
include::ref-storage-format.txt[]
319
319
320
- -j <n>::
321
- --jobs <n>::
320
+ `-j` _ <n>_ ::
321
+ ` --jobs` _ <n>_ ::
322
322
The number of submodules fetched at the same time.
323
323
Defaults to the `submodule.fetchJobs` option.
324
324
325
- <repository>::
325
+ _ <repository>_ ::
326
326
The (possibly remote) _<repository>_ to clone from. See the
327
327
<<URLS,GIT URLS>> section below for more information on specifying
328
328
repositories.
329
329
330
- <directory>::
330
+ _ <directory>_ ::
331
331
The name of a new directory to clone into. The "humanish"
332
332
part of the source repository is used if no _<directory>_ is
333
333
explicitly given (`repo` for `/path/to/repo.git` and `foo`
334
334
for `host.xz:foo/.git`). Cloning into an existing directory
335
335
is only allowed if the directory is empty.
336
336
337
- --bundle-uri=<uri>::
337
+ ` --bundle-uri=`{empty}__ <uri>__ ::
338
338
Before fetching from the remote, fetch a bundle from the given
339
339
_<uri>_ and unbundle the data into the local repository. The refs
340
340
in the bundle will be stored under the hidden `refs/bundle/*`
0 commit comments