Commit 15ff8dcb authored by Nick Thomas's avatar Nick Thomas

Document GIT_STRATEGY=none

[ci skip]
parent bac56e3b
...@@ -858,27 +858,45 @@ job: ...@@ -858,27 +858,45 @@ job:
## Git Strategy ## Git Strategy
> Introduced in GitLab 8.9 as an experimental feature. May change in future > Introduced in GitLab 8.9 as an experimental feature. May change or be removed
releases or be removed completely. completely in future releases. `GIT_STRATEGY=none` requires GitLab Runner
v1.7+.
You can set the `GIT_STRATEGY` used for getting recent application code, either
in the global [`variables`](#variables) section or the [`variables`](#job-variables)
section for individual jobs. If left unspecified, the default from project
settings will be used.
You can set the `GIT_STRATEGY` used for getting recent application code. `clone` There are three possible values: `clone`, `fetch`, and `none`.
is slower, but makes sure you have a clean directory before every build. `fetch`
is faster. `GIT_STRATEGY` can be specified in the global `variables` section or `clone` is the slowest option. It clones the repository from scratch for every
in the `variables` section for individual jobs. If it's not specified, then the job, ensuring that the project workspace is always pristine.
default from project settings will be used.
``` ```
variables: variables:
GIT_STRATEGY: clone GIT_STRATEGY: clone
``` ```
or `fetch` is faster as it re-uses the project workspace (falling back to `clone`
if it doesn't exist). `git clean` is used to undo any changes made by the last
job, and `git fetch` is used to retrieve commits made since the last job ran.
``` ```
variables: variables:
GIT_STRATEGY: fetch GIT_STRATEGY: fetch
``` ```
`none` also re-uses the project workspace, but skips all Git operations
(including GitLab Runner's pre-clone script, if present). It is mostly useful
for jobs that operate exclusively on artifacts (e.g., `deploy`). Git repository
data may be present, but it is certain to be out of date, so you should only
rely on files brought into the project workspace from cache or artifacts.
```
variables:
GIT_STRATEGY: none
```
## Shallow cloning ## Shallow cloning
> Introduced in GitLab 8.9 as an experimental feature. May change in future > Introduced in GitLab 8.9 as an experimental feature. May change in future
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment