DVC initialisieren und einen Datensatz verfolgen
Führen Sie dvc add aus und committen Sie den Verweis, nicht die Daten.
DVC initialisieren und einen Datensatz verfolgen ist eine kostenlose MLOps Academy-Lektion auf CoddyKit. Dies ist Lektion 2 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des MLOps Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der MLOps Academy-Kurs umfasst insgesamt 4 Lektionen.
Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.
Install DVC First
DVC is a Python package, so a single pip command gets you started. After this you have the dvc command available in your terminal.
pip install dvcStart Inside a Git Repo
DVC works alongside Git, not instead of it. So you run it inside an existing Git repository where your code already lives.
git init
dvc initWhat dvc init Creates
dvc init adds a hidden .dvc folder holding config and the local cache. Commit it once so the whole team shares the same setup.
git add .dvc .dvcignore
git commit -m "Initialize DVC"Track Your First Dataset
Point DVC at the file or folder you want versioned with dvc add. DVC moves the real data into its cache and leaves a small placeholder behind.
dvc add data/train.csvThe .dvc Pointer File
dvc add creates a tiny .dvc file next to your data. It stores the file's hash and size, acting as the address Git will track.
# data/train.csv.dvc
outs:
- md5: 3f2a9c...
size: 524288
path: train.csvGit Tracks the Pointer
You commit the small .dvc file to Git, never the raw dataset. Git now records which version of the data this commit expects.
git add data/train.csv.dvc
git commit -m "Track training data"Real Data Goes to .gitignore
So you never commit the big file by accident, dvc add auto-adds the dataset path to .gitignore. Git simply ignores the heavy bytes.
cat .gitignore
# /train.csvContent-Addressable Cache
DVC names cached files by their content hash. Identical data is stored once, so duplicate datasets never waste disk space. 💾
Check the Status
Run dvc status any time to see whether your working data matches what the .dvc files expect. It is your quick health check.
dvc statusUpdate a Tracked File
When the dataset changes, just run dvc add again. DVC recomputes the hash and updates the .dvc file, which you commit as a new version.
dvc add data/train.csv
git add data/train.csv.dvc
git commit -m "New data snapshot"Track Folders Too
dvc add works on whole directories, not just single files. Point it at a folder and DVC versions everything inside as one tracked unit.
dvc add data/images/Quick Check
After running dvc add on a dataset, what do you commit to Git?
Recap
You ran dvc init, then dvc add to track a dataset. DVC caches the real data and writes a tiny .dvc pointer that Git commits, keeping code and data linked.
Häufig gestellte Fragen
Ist die Lektion „DVC initialisieren und einen Datensatz verfolgen“ kostenlos?
Ja — der vollständige Text von „DVC initialisieren und einen Datensatz verfolgen“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des MLOps Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der MLOps Academy-Kurs umfasst insgesamt 4 Lektionen.
Was lerne ich in „DVC initialisieren und einen Datensatz verfolgen“?
Führen Sie dvc add aus und committen Sie den Verweis, nicht die Daten. Du übst MLOps Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.
Brauche ich Erfahrung, um MLOps Academy zu starten?
Keine Vorkenntnisse erforderlich. MLOps Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 2 von 4.
Wie lange dauert die Lektion „DVC initialisieren und einen Datensatz verfolgen“?
Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.
Kann ich in dieser MLOps Academy-Lektion Code schreiben und ausführen?
Ja. Jede MLOps Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.
Alle Lektionen in diesem Kurs
- Warum Git allein Daten nicht versionieren kann
- DVC initialisieren und einen Datensatz verfolgen
- Daten in einem Remotespeicher ablegen
- Zu einem früheren Datensatz zurückkehren