doc: git-clone: apply new documentation formatting guidelines
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jean-Noël Avila committed
Mar 29, 2024 at 11:19 UTC
76880f0510c6be9f6385f2d43dcfcba4eca9ccbc
3 files changed
+86
-84
Documentation/config/clone.txt
+3
-3
@@ -1,13 +1,13 @@
1
-clone.defaultRemoteName::
1
+`clone.defaultRemoteName`::
2
The name of the remote to create when cloning a repository. Defaults to
3
`origin`, and can be overridden by passing the `--origin` command-line
4
option to linkgit:git-clone[1].
5
6
-clone.rejectShallow::
6
+`clone.rejectShallow`::
7
Reject cloning a repository if it is a shallow one; this can be overridden by
8
passing the `--reject-shallow` option on the command line. See linkgit:git-clone[1]
9
10
-clone.filterSubmodules::
10
+`clone.filterSubmodules`::
11
If a partial clone filter is provided (see `--filter` in
12
linkgit:git-rev-list[1]) and `--recurse-submodules` is used, also apply
13
the filter to submodules.
Documentation/git-clone.txt
+60
-60
@@ -9,15 +9,15 @@ git-clone - Clone a repository into a new directory
9
SYNOPSIS
10
--------
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
22
DESCRIPTION
23
-----------
@@ -31,7 +31,7 @@ currently active branch.
31
After the clone, a plain `git fetch` without arguments will update
32
all the remote-tracking branches, and a `git pull` without
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
is given; see below).
36
37
This default configuration is achieved by creating references to
@@ -42,12 +42,12 @@ configuration variables.
42
43
OPTIONS
44
-------
45
--l::
46
---local::
45
+`-l`::
46
+`--local`::
47
When the repository to clone from is on a local machine,
48
this flag bypasses the normal "Git aware" transport
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
The files under `.git/objects/` directory are hardlinked
52
to save space when possible.
53
+
@@ -67,14 +67,14 @@ links.
67
source repository, similar to running `cp -r src dst` while modifying
68
`src`.
69
70
---no-hardlinks::
70
+`--no-hardlinks`::
71
Force the cloning process from a repository on a local
72
filesystem to copy the files under the `.git/objects`
73
directory instead of using hardlinks. This may be desirable
74
if you are trying to make a back-up of your repository.
75
76
--s::
77
---shared::
76
+`-s`::
77
+`--shared`::
78
When the repository to clone is on the local machine,
79
instead of using hard links, automatically setup
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
its source repository, you can simply run `git repack -a` to copy all
102
objects from the source repository into a pack in the cloned repository.
103
104
---reference[-if-able] <repository>::
104
+`--reference`[`-if-able`] _<repository>_::
105
If the reference _<repository>_ is on the local machine,
106
automatically setup `.git/objects/info/alternates` to
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
*NOTE*: see the NOTE for the `--shared` option, and also the
116
`--dissociate` option.
117
118
---dissociate::
118
+`--dissociate`::
119
Borrow the objects from reference repositories specified
120
with the `--reference` options only to reduce network
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
same repository, and this option can be used to stop the
127
borrowing.
128
129
--q::
130
---quiet::
129
+`-q`::
130
+`--quiet`::
131
Operate quietly. Progress is not reported to the standard
132
error stream.
133
134
--v::
135
---verbose::
134
+`-v`::
135
+`--verbose`::
136
Run verbosely. Does not affect the reporting of progress status
137
to the standard error stream.
138
139
---progress::
139
+`--progress`::
140
Progress status is reported on the standard error stream
141
by default when it is attached to a terminal, unless `--quiet`
142
is specified. This flag forces progress status even if the
143
standard error stream is not directed to a terminal.
144
145
---server-option=<option>::
145
+++--server-option=++__<option>__::
146
Transmit the given string to the server when communicating using
147
protocol version 2. The given string must not contain a NUL or LF
148
character. The server's handling of server options, including
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
sent to the other side in the order listed on the command line.
152
153
--n::
154
---no-checkout::
153
+`-n`::
154
+`--no-checkout`::
155
No checkout of HEAD is performed after the clone is complete.
156
157
---[no-]reject-shallow::
157
+`--`[`no-`]`reject-shallow`::
158
Fail if the source repository is a shallow repository.
159
The `clone.rejectShallow` configuration variable can be used to
160
specify the default.
161
162
---bare::
162
+`--bare`::
163
Make a 'bare' Git repository. That is, instead of
164
creating _<directory>_ and placing the administrative
165
- files in `<directory>/.git`, make the _<directory>_
165
+ files in _<directory>_`/.git`, make the _<directory>_
166
itself the `$GIT_DIR`. This obviously implies the `--no-checkout`
167
because there is nowhere to check out the working tree.
168
Also the branch heads at the remote are copied directly
@@ -171,28 +171,28 @@ objects from the source repository into a pack in the cloned repository.
171
used, neither remote-tracking branches nor the related
172
configuration variables are created.
173
174
---sparse::
174
+`--sparse`::
175
Employ a sparse-checkout, with only files in the toplevel
176
directory initially being present. The
177
linkgit:git-sparse-checkout[1] command can be used to grow the
178
working directory as needed.
179
180
---filter=<filter-spec>::
180
+++--filter=++__<filter-spec>__::
181
Use the partial clone feature and request that the server sends
182
a subset of reachable objects according to a given object filter.
183
When using `--filter`, the supplied _<filter-spec>_ is used for
184
the partial clone filter. For example, `--filter=blob:none` will
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
at least _<size>_. For more details on filter specifications, see
188
the `--filter` option in linkgit:git-rev-list[1].
189
190
---also-filter-submodules::
190
+`--also-filter-submodules`::
191
Also apply the partial clone filter to any submodules in the repository.
192
Requires `--filter` and `--recurse-submodules`. This can be turned on by
193
default by setting the `clone.filterSubmodules` config option.
194
195
---mirror::
195
+`--mirror`::
196
Set up a mirror of the source repository. This implies `--bare`.
197
Compared to `--bare`, `--mirror` not only maps local branches of the
198
source to local branches of the target, it maps all refs (including
@@ -200,14 +200,14 @@ objects from the source repository into a pack in the cloned repository.
200
that all these refs are overwritten by a `git remote update` in the
201
target repository.
202
203
--o <name>::
204
---origin <name>::
203
+`-o` _<name>_::
204
+`--origin` _<name>_::
205
Instead of using the remote name `origin` to keep track of the upstream
206
repository, use _<name>_. Overrides `clone.defaultRemoteName` from the
207
config.
208
209
--b <name>::
210
---branch <name>::
209
+`-b` _<name>_::
210
+`--branch` _<name>_::
211
Instead of pointing the newly created HEAD to the branch pointed
212
to by the cloned repository's HEAD, point to _<name>_ branch
213
instead. In a non-bare repository, this is the branch that will
@@ -215,18 +215,18 @@ objects from the source repository into a pack in the cloned repository.
215
`--branch` can also take tags and detaches the HEAD at that commit
216
in the resulting repository.
217
218
--u <upload-pack>::
219
---upload-pack <upload-pack>::
218
+`-u` _<upload-pack>_::
219
+`--upload-pack` _<upload-pack>_::
220
When given, and the repository to clone from is accessed
221
via ssh, this specifies a non-default path for the command
222
run on the other end.
223
224
---template=<template-directory>::
224
+++--template=++__<template-directory>__::
225
Specify the directory from which templates will be used;
226
(See the "TEMPLATE DIRECTORY" section of linkgit:git-init[1].)
227
228
--c <key>=<value>::
229
---config <key>=<value>::
228
+`-c` __<key>__++=++__<value>__::
229
+`--config` __<key>__++=++__<value>__::
230
Set a configuration variable in the newly-created repository;
231
this takes effect immediately after the repository is
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
Due to limitations of the current implementation, some configuration
240
variables do not take effect until after the initial fetch and checkout.
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
corresponding `--mirror` and `--no-tags` options instead.
244
245
---depth <depth>::
245
+`--depth` _<depth>_::
246
Create a 'shallow' clone with a history truncated to the
247
specified number of commits. Implies `--single-branch` unless
248
`--no-single-branch` is given to fetch the histories near the
249
tips of all branches. If you want to clone submodules shallowly,
250
also pass `--shallow-submodules`.
251
252
---shallow-since=<date>::
252
+++--shallow-since=++__<date>__::
253
Create a shallow clone with a history after the specified time.
254
255
---shallow-exclude=<revision>::
255
+++--shallow-exclude=++__<revision>__::
256
Create a shallow clone with a history, excluding commits
257
reachable from a specified remote branch or tag. This option
258
can be specified multiple times.
259
260
---[no-]single-branch::
260
+`--`[`no-`]`single-branch`::
261
Clone only the history leading to the tip of a single branch,
262
either specified by the `--branch` option or the primary
263
branch remote's `HEAD` points at.
@@ -267,7 +267,7 @@ corresponding `--mirror` and `--no-tags` options instead.
267
branch when `--single-branch` clone was made, no remote-tracking
268
branch is created.
269
270
---no-tags::
270
+`--no-tags`::
271
Don't clone any tags, and set
272
`remote.<remote>.tagOpt=--no-tags` in the config, ensuring
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
branch. This is useful e.g. to maintain minimal clones of the default
280
branch of some repository for search indexing.
281
282
---recurse-submodules[=<pathspec>]::
282
+`--recurse-submodules`[`=`{empty}__<pathspec>__]::
283
After the clone is created, initialize and clone submodules
284
within based on the provided _<pathspec>_. If no _=<pathspec>_ is
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
not have a worktree/checkout (i.e. if any of `--no-checkout`/`-n`, `--bare`,
296
or `--mirror` is given)
297
298
---[no-]shallow-submodules::
298
+`--`[`no-`]`shallow-submodules`::
299
All submodules which are cloned will be shallow with a depth of 1.
300
301
---[no-]remote-submodules::
301
+`--`[`no-`]`remote-submodules`::
302
All submodules which are cloned will use the status of the submodule's
303
remote-tracking branch to update the submodule, rather than the
304
superproject's recorded SHA-1. Equivalent to passing `--remote` to
305
`git submodule update`.
306
307
---separate-git-dir=<git-dir>::
307
+`--separate-git-dir=`{empty}__<git-dir>__::
308
Instead of placing the cloned repository where it is supposed
309
to be, place the cloned repository at the specified directory,
310
then make a filesystem-agnostic Git symbolic link to there.
311
The result is Git repository can be separated from working
312
tree.
313
314
---ref-format=<ref-format>::
314
+`--ref-format=`{empty}__<ref-format>__::
315
316
Specify the given ref storage format for the repository. The valid values are:
317
+
318
include::ref-storage-format.txt[]
319
320
--j <n>::
321
---jobs <n>::
320
+`-j` _<n>_::
321
+`--jobs` _<n>_::
322
The number of submodules fetched at the same time.
323
Defaults to the `submodule.fetchJobs` option.
324
325
-<repository>::
325
+_<repository>_::
326
The (possibly remote) _<repository>_ to clone from. See the
327
<<URLS,GIT URLS>> section below for more information on specifying
328
repositories.
329
330
-<directory>::
330
+_<directory>_::
331
The name of a new directory to clone into. The "humanish"
332
part of the source repository is used if no _<directory>_ is
333
explicitly given (`repo` for `/path/to/repo.git` and `foo`
334
for `host.xz:foo/.git`). Cloning into an existing directory
335
is only allowed if the directory is empty.
336
337
---bundle-uri=<uri>::
337
+`--bundle-uri=`{empty}__<uri>__::
338
Before fetching from the remote, fetch a bundle from the given
339
_<uri>_ and unbundle the data into the local repository. The refs
340
in the bundle will be stored under the hidden `refs/bundle/*`
Documentation/urls.txt
+23
-21
@@ -15,14 +15,14 @@ should be used with caution on unsecured networks.
15
16
The following syntaxes may be used with them:
17
18
-- ssh://{startsb}user@{endsb}host.xz{startsb}:port{endsb}/path/to/repo.git/
19
-- git://host.xz{startsb}:port{endsb}/path/to/repo.git/
20
-- http{startsb}s{endsb}://host.xz{startsb}:port{endsb}/path/to/repo.git/
21
-- ftp{startsb}s{endsb}://host.xz{startsb}:port{endsb}/path/to/repo.git/
18
+- ++ssh://++{startsb}__<user>__++@++{endsb}__<host>__{startsb}++:++__<port>__{endsb}++/++__<path-to-git-repo>__
19
+- ++git://++__<host>__{startsb}:__<port>__{endsb}++/++__<path-to-git-repo>__
20
+- ++http++{startsb}++s++{endsb}++://++__<host>__{startsb}++:++__<port>__{endsb}++/++__<path-to-git-repo>__
21
+- ++ftp++{startsb}++s++{endsb}++://++__<host>__{startsb}++:++__<port>__{endsb}++/++__<path-to-git-repo>__
22
23
An alternative scp-like syntax may also be used with the ssh protocol:
24
25
-- {startsb}user@{endsb}host.xz:path/to/repo.git/
25
+- {startsb}__<user>__++@++{endsb}__<host>__++:/++__<path-to-git-repo>__
26
27
This syntax is only recognized if there are no slashes before the
28
first colon. This helps differentiate a local path that contains a
@@ -30,17 +30,17 @@ colon. For example the local path `foo:bar` could be specified as an
30
absolute path or `./foo:bar` to avoid being misinterpreted as an ssh
31
url.
32
33
-The ssh and git protocols additionally support ~username expansion:
33
+The ssh and git protocols additionally support ++~++__<username>__ expansion:
34
35
-- ssh://{startsb}user@{endsb}host.xz{startsb}:port{endsb}/~{startsb}user{endsb}/path/to/repo.git/
36
-- git://host.xz{startsb}:port{endsb}/~{startsb}user{endsb}/path/to/repo.git/
37
-- {startsb}user@{endsb}host.xz:/~{startsb}user{endsb}/path/to/repo.git/
35
+- ++ssh://++{startsb}__<user>__++@++{endsb}__<host>__{startsb}++:++__<port>__{endsb}++/~++__<user>__++/++__<path-to-git-repo>__
36
+- ++git://++__<host>__{startsb}++:++__<port>__{endsb}++/~++__<user>__++/++__<path-to-git-repo>__
37
+- {startsb}__<user>__++@++{endsb}__<host>__++:~++__<user>__++/++__<path-to-git-repo>__
38
39
For local repositories, also supported by Git natively, the following
40
syntaxes may be used:
41
42
-- /path/to/repo.git/
43
-- \file:///path/to/repo.git/
42
+- `/path/to/repo.git/`
43
+- ++file:///path/to/repo.git/++
44
45
ifndef::git-clone[]
46
These two syntaxes are mostly equivalent, except when cloning, when
@@ -57,11 +57,11 @@ endif::git-clone[]
57
accept a suitable bundle file. See linkgit:git-bundle[1].
58
59
When Git doesn't know how to handle a certain transport protocol, it
60
-attempts to use the `remote-<transport>` remote helper, if one
60
+attempts to use the `remote-`{empty}__<transport>__ remote helper, if one
61
exists. To explicitly request a remote helper, the following syntax
62
may be used:
63
64
-- _<transport>_::_<address>_
64
+- _<transport>_::__<address>__
65
66
where _<address>_ may be a path, a server and path, or an arbitrary
67
URL-like string recognized by the specific remote helper being
@@ -72,10 +72,11 @@ you want to use a different format for them (such that the URLs you
72
use will be rewritten into URLs that work), you can create a
73
configuration section of the form:
74
75
-------------
76
- [url "<actual-url-base>"]
77
- insteadOf = <other-url-base>
78
-------------
75
+[verse]
76
+--
77
+ [url "__<actual-url-base>__"]
78
+ insteadOf = _<other-url-base>_
79
+--
80
81
For example, with this:
82
@@ -91,10 +92,11 @@ rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".
92
If you want to rewrite URLs for push only, you can create a
93
configuration section of the form:
94
94
-------------
95
- [url "<actual-url-base>"]
96
- pushInsteadOf = <other-url-base>
97
-------------
95
+[verse]
96
+--
97
+ [url "__<actual-url-base>__"]
98
+ pushInsteadOf = _<other-url-base>_
99
+--
100
101
For example, with this:
102