Skip to content

Commit

Permalink
user-guide: add troubleshooting entry for dvc-exp in shallow clones
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrowla committed May 20, 2022
1 parent d29478e commit d24e508
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions content/docs/user-guide/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,39 @@ experiments.
[git credentials]: https://git-scm.com/docs/gitcredentials
[ssh git url]:
https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols#_the_protocols

## DVC experiments may fail in shallow Git repositories {#git-shallow}

DVC experiments rely on Git features which may not work properly in shallow Git
repositories. This error commonly occurs in certain CI environments which use
shallow git clones by default. When this error is encountered, try unshallowing
the Git repository and then retry the DVC command.

Local Git repositories can be unshallowed by using:

```
$ git fetch --unshallow
```

When using [CML](https://cml.dev/doc), repositories can be unshallowed by using:

```
$ cml ci --unshallow
```

In GitHub Actions, repositories can be unshallowed by setting `fetch-depth` in
the `actions/checkout` action.

```
- uses: actions/checkout@v3
with:
fetch-depth: 0
```

In GitLab CI/CD, repositories can be unshallowed by setting the `GIT_DEPTH`
environment variable:

```
variables:
GIT_DEPTH: "0"
```

0 comments on commit d24e508

Please sign in to comment.