diff --git a/dvc/command/init.py b/dvc/command/init.py index 40bda25e5..4bbeac7e0 100644 --- a/dvc/command/init.py +++ b/dvc/command/init.py @@ -5,6 +5,7 @@ from dvc.command.common.base import CmdBase from dvc.logger import Logger from dvc.config import Config from dvc.exceptions import DvcException +from dvc.path.data_item import DataItem class InitError(DvcException): @@ -107,7 +108,8 @@ ProjectName = conf_file.close() self.git.modify_gitignore([os.path.join(config_dir_path.name, cache_dir_path.name), - os.path.join(config_dir_path.name, os.path.basename(self.git.lock_file))]) + os.path.join(config_dir_path.name, os.path.basename(self.git.lock_file)), + os.path.join(config_dir_path.name, state_dir_path.name, '*' + DataItem.LOCAL_STATE_FILE_SUFFIX)]) message = 'DVC init. cache dir {}, state dir {}, '.format(cache_dir_path.name, state_dir_path.name) return self.commit_if_needed(message) diff --git a/dvc/path/data_item.py b/dvc/path/data_item.py index 9eafeff70..46664e6b9 100644 --- a/dvc/path/data_item.py +++ b/dvc/path/data_item.py @@ -125,4 +125,3 @@ class DataItem(object): cache_state = CacheStateFile(self).save() local_state = LocalStateFile(self).save() - self._git.modify_gitignore([self.local_state.relative]) diff --git a/requirements.txt b/requirements.txt index 960334c00..cd8e3ff86 100644 --- a/requirements.txt +++ b/requirements.txt @@ -90,3 +90,4 @@ configobj==5.0.6 networkx==1.11 gcs-oauth2-boto-plugin==1.14 xmltodict==0.11.0 +pyyaml==3.12 diff --git a/setup.py b/setup.py index 7c2099104..2d1ef2b83 100644 --- a/setup.py +++ b/setup.py @@ -95,6 +95,7 @@ install_requires = [ 'configobj==5.0.6', 'networkx==1.11', 'gcs-oauth2-boto-plugin==1.14', + 'pyyaml==3.12', ] if platform.system() == 'Darwin':