DVC로 배우는 데이터 버저닝 입문
Ravi Bhadauria
Machine Learning Engineer
pip로 전역 설치 $ pip install dvc
$ dvc version
DVC version: 3.40.1 (pip)Platform: Python 3.9.16 on macOS-14.2.1-arm64-arm-64bitConfig: Global: /Users/<username>/Library/Application Support/dvc System: /Library/Application Support/dvcRepo: dvc, git
$ git init
Initialized empty Git repository in /path/to/repo/.git/
$ dvc init
Initialized DVC repository.
You can now commit the changes to git.
$ git status
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: .dvc/.gitignore
new file: .dvc/config
new file: .dvcignore
$ git commit -m "initialized dvc"
.gitignore와 유사한 파일
필요 없는 대규모 데이터 파일을 추적할 때 유용
# .dvcignore # 'data' 디렉터리의 모든 파일 무시 data/*# 단, 'data/data.csv'는 무시하지 않음 !data/data.csv# 모든 .tmp 파일 무시 *.tmp
dvc check-ignore 명령 사용$ dvc check-ignore data/file.txt
data/file.txt
-d 플래그 사용$ dvc check-ignore -d data/file.txt
.dvcignore:3:data/* data/file.txt
pip install dvc로 DVC 설치dvc versiondvc init.dvcignore에 지정.gitignore와 유사, 같은 문법dvc check-ignore <filename>DVC로 배우는 데이터 버저닝 입문