Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
5de95d4e
Commit
5de95d4e
authored
Jun 17, 2016
by
Mark Pundsack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update GIT_DEPTH wording
parent
4e0f9eeb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
8 deletions
+26
-8
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+26
-8
No files found.
doc/ci/yaml/README.md
View file @
5de95d4e
...
@@ -819,11 +819,14 @@ job:
...
@@ -819,11 +819,14 @@ job:
## Git Strategy
## Git Strategy
>**Note:**
>**Note:**
Introduced in GitLab 8.9 as an experimental feature
Introduced in GitLab 8.9 as an experimental feature. May change in future
releases or be removed completely.
You can set the
`GIT_STRATEGY`
used for getting recent application code.
`clone`
You can set the
`GIT_STRATEGY`
used for getting recent application code.
`clone`
is slower, but makes sure you have a clean directory before every build.
`fetch`
is slower, but makes sure you have a clean directory before every build.
`fetch`
is faster. If specified, it will override the project settings in the web UI.
is faster.
`GIT_STRATEGY`
can be specified in the global
`variables`
section or
in the
`variables`
section for individual jobs. If it's not specified, then the
default from project settings will be used.
```
```
variables:
variables:
...
@@ -840,17 +843,32 @@ variables:
...
@@ -840,17 +843,32 @@ variables:
## Shallow cloning
## Shallow cloning
>**Note:**
>**Note:**
Introduced in GitLab 8.9 as an experimental feature
Introduced in GitLab 8.9 as an experimental feature. May change in future
releases or be removed completely.
You can specify the depth of fetching and cloning using
`GIT_DEPTH`
. This allows
You can specify the depth of fetching and cloning using
`GIT_DEPTH`
. This allows
shallow cloning of the repository. The value is passed to
`git fetch`
and
`git
shallow cloning of the repository which can significantly speed up cloning for
clone`
. If set while cloning, it will imply
`--shallow-modules`
, which means
repositories with a large number of commits or old, large binaries. The value is
submodules will be cloned with a depth of 1 regardless of the value of
passed to
`git fetch`
and
`git clone`
.
`GIT_DEPTH`
.
>**Note:**
If you use a depth of 1 and have a queue of builds or retry
builds, jobs may fail.
Since Git fetching and cloning is based on a ref, such as a branch name, runners
can't clone a specific commit SHA. If there are multiple builds in the queue, or
you are retrying an old build, the commit to be tested needs to be within the
git history that is cloned. Setting too small a value for
`GIT_DEPTH`
can make
it impossible to run these old commits. You will see
`unresolved reference`
in
build logs. You should then reconsider changing
`GIT_DEPTH`
to a higher value.
Builds that rely on
`git describe`
may not work correctly when
`GIT_DEPTH`
is
set since only part of the git history is present.
To fetch or clone only the last 3 commits:
```
```
variables:
variables:
GIT_DEPTH: "
1
"
GIT_DEPTH: "
3
"
```
```
## Hidden jobs
## Hidden jobs
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment