Skip to content

Commit f966ec0

Browse files
Jim Minterbmcelvee
Jim Minter
authored andcommitted
[enterprise-3.5] correct documented 'git clone' behaviour
(cherry picked from commit caece2f) xref:openshift#7108
1 parent 3af22b0 commit f966ec0

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

dev_guide/builds/build_inputs.adoc

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -216,19 +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 regular Git clone operation and
227-
checkout the commit, because using the `--depth=1` option only works with named
228-
branch refs.
229-
230-
To perform a full Git clone of the `master` for the specified repository, set
231-
the `ref` to `master`.
219+
If the `ref` field denotes a pull request, the system will use a `git fetch`
220+
operation and then checkout `FETCH_HEAD`.
221+
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`).
232228

233229
[[using-a-proxy-for-git-cloning]]
234230
=== Using a Proxy

0 commit comments

Comments
 (0)