Skip to content

Commit 28a1b56

Browse files
sschuberthgitster
authored andcommitted
docs: clarify that passing --depth to git-clone implies --single-branch
It is confusing to document how --depth behaves as part of the --single-branch docs. Better move that part to the --depth docs, saying that it implies --single-branch by default. Signed-off-by: Sebastian Schuberth <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 282616c commit 28a1b56

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Documentation/git-clone.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,14 @@ objects from the source repository into a pack in the cloned repository.
178178

179179
--depth <depth>::
180180
Create a 'shallow' clone with a history truncated to the
181-
specified number of revisions.
181+
specified number of revisions. Implies `--single-branch` unless
182+
`--no-single-branch` is given to fetch the histories near the
183+
tips of all branches.
182184

183185
--[no-]single-branch::
184186
Clone only the history leading to the tip of a single branch,
185187
either specified by the `--branch` option or the primary
186-
branch remote's `HEAD` points at. When creating a shallow
187-
clone with the `--depth` option, this is the default, unless
188-
`--no-single-branch` is given to fetch the histories near the
189-
tips of all branches.
188+
branch remote's `HEAD` points at.
190189
Further fetches into the resulting repository will only update the
191190
remote-tracking branch for the branch this option was used for the
192191
initial cloning. If the HEAD at the remote did not point at any

0 commit comments

Comments
 (0)