Skip to content

Commit d286771

Browse files
authored
Merge pull request openshift#7108 from jim-minter/bz1533129
correct documented 'git clone' behaviour
2 parents 072779f + caece2f commit d286771

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

dev_guide/builds/build_inputs.adoc

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -216,22 +216,15 @@ containing a Dockerfile that overwrites any Dockerfile that may exist in the
216216
source repository.
217217
endif::[]
218218

219-
When using the Git repository as a source without specifying the `ref`
220-
field, {product-title} performs a shallow clone (`--depth=1` clone). That means
221-
only the `HEAD` (usually the `master` branch) is downloaded. This results
222-
in repositories downloading faster, including the commit history.
223-
224-
A shallow clone is also used when the `ref` field is specified and set to an
225-
existing remote branch name. However, if you specify the `ref` field to a
226-
specific commit, the system will fallback to a `git clone` operation and
227-
checkout the commit, because using the `--depth=1` option only works with named
228-
branch refs.
229-
230219
If the `ref` field denotes a pull request, the system will use a `git fetch` operation
231220
and then checkout `FETCH_HEAD`.
232221

233-
To perform a full `git clone` of the `master` for the specified repository, set
234-
the `ref` to `master`.
222+
When no `ref` value is provided, {product-title} performs a shallow clone
223+
(`--depth=1`). In this case, only the files associated with the most recent
224+
commit on the default branch (typically `master`) are downloaded. This results
225+
in repositories downloading faster, but without the full commit history. To
226+
perform a full `git clone` of the default branch of a specified repository, set
227+
`ref` to the name of the default branch (for example `master`).
235228

236229
[[using-a-proxy-for-git-cloning]]
237230
=== Using a Proxy

0 commit comments

Comments
 (0)