Difficulty: Intermediate
Estimated Time: 5-10 minutes

Sometimes you might want DVC to ignore some files while working with the project. For example, when working in a workspace directory with a large number of data files, you might encounter extended execution time for operations as simple as dvc status. In an other case you might want to omit files or folders unrelated to the project (like .DS_Store on Mac).

To address these scenarios, DVC supports optional .dvcignore files, which have the same syntax and work similarly to .gitignore in Git. They can be placed in the root of the project or inside any subdirectory, and they contain a pattern on each line. During execution of commands that traverse directories, DVC will ignore the matching paths.

.dvcignore

Step 1 of 4

Step 1

Initialize

  1. Create a test project:

    mkdir proj1

    cd proj1/

    dvc init --no-scm -q

  2. Create a data directory:

    mkdir data

    echo data1 > data/data1

    echo data2 > data/data2

    tree -a