diff options
author | Jan Christophersen <jan@ruken.pw> | 2017-05-31 17:53:28 +0000 |
---|---|---|
committer | Achilleas Pipinellis <axilleas@axilleas.me> | 2017-05-31 17:53:28 +0000 |
commit | 2ff3dcaddea075a559163cf3280b0139ca34bd4d (patch) | |
tree | 2c002f952cf8eaefabab0d62347bd2c455e8f5c9 /doc/ci/yaml | |
parent | bfa46a9eabbad40ab57454fd7233d8c3e199ed98 (diff) | |
download | gitlab-ce-2ff3dcaddea075a559163cf3280b0139ca34bd4d.tar.gz |
Add Documentation for GIT_CHECKOUT variable
Diffstat (limited to 'doc/ci/yaml')
-rw-r--r-- | doc/ci/yaml/README.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index 2df03196f80..fab5d14ac54 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -1105,6 +1105,36 @@ variables: GIT_STRATEGY: none ``` +## Git Checkout + +> Introduced in GitLab Runner 9.3 + +The `GIT_CHECKOUT` variable can be used when the `GIT_STRATEGY` is set to either +`clone` or `fetch` to specify whether a `git checkout` should be run. If not +specified, it defaults to true. Like `GIT_STRATEGY`, it can be set in either the +global [`variables`](#variables) section or the [`variables`](#job-variables) +section for individual jobs. + +If set to `false`, the Runner will: + +- when doing `fetch` - update the repository and leave working copy on + the current revision, +- when doing `clone` - clone the repository and leave working copy on the + default branch. + +Having this setting set to `true` will mean that for both `clone` and `fetch` +strategies the Runner will checkout the working copy to a revision related +to the CI pipeline: + +```yaml +variables: + GIT_STRATEGY: clone + GIT_CHECKOUT: false +script: + - git checkout master + - git merge $CI_BUILD_REF_NAME +``` + ## Git Submodule Strategy > Requires GitLab Runner v1.10+. |