In the above example `.gitlab-ci-before-script-template.yml` content will be automatically fetched and evaluated along with the content of `gitlab-ci.yml`.
In the above example `.before-script-template.yml` content will be automatically fetched and evaluated along with the content of `gitlab-ci.yml`.
`include` supports two types of files:
`include` supports two types of files:
-**local** to the same repository, referenced using the relative path, or
-**remote** in a different location, accessed using HTTP protocol, referenced using the full URL
-**local** to the same repository, referenced using the paths in the same the repository, i.e:
```yaml
# Within the repository
include:'/templates/.gitlab-ci-template.yml'
```
-**remote** in a different location, accessed using HTTP/HTTPS protocol, referenced using the full URL, i.e:
- We can only use files that are currently tracked by Git on the same branch and commit your configuration file is. In other words, when using a **local file** make sure it's on the latest commit of your branch.
- We can only use files that are currently tracked by Git on the same branch your configuration file is. In other words, when using a **local file** make sure that both, `gitlab-ci.yml` and the local file are on the same branch.
- Since external files defined on `include` are evaluated first, the content on `gitlab-ci.yml`**will take precedence over the content of the external files**, for example:
- Since external files defined on `include` are evaluated first, the content on `gitlab-ci.yml`**will always take precedence over the content of the external files, no matters of the position of the `include` keyword, allowing to override values and functions with local definitions**, for example:
```yaml
```yaml
# Content of http://company.com/default-gitlab-ci.yml
# Content of http://company.com/ruby-autodeploy-template.yml
In this case, the variable `KUBE_DOMAIN` and the `deploy` job defined on `ruby-autodeploy-template.yml` will override by the ones defined on `gitlab-ci.yml`.