Does DVC actually require Git, or would Mercurial work just as well?

My question is as the title states really, does DVC actually require Git, or would Mercurial work just as well? Does DVC actually call Git to do anything, or does it just store information in normal files which the user commits.

Hi @crobar !

DVC uses Git for things such as:

  1. adding files tracked by dvc to .gitignore for user comfort;
  2. once calling git add after dvc init for user comfort;
  3. iterating git branches to retrieve information about used dvc files and metrics(e.g. dvc push --all-branches and dvc metrics show --all-branches);

That is pretty much it. User does all the other git add-ing and git commit-ing. Dvc stores information about your data in plain yaml files that are committed by user to git.

DVC doesn’t generally require Git, it can even work without any SCM system(use dvc init --no-scm for that) if you don’t need those there features listed above. We have thought about supporting other SCMs and thus left a possibility to easily extend the list of supported SCMs by simply adding a proper driver to Git class as an example). So it should be pretty easy to support Hg. I’ve added to track the progress on it, we will be sure to take a look at it in the nearest future. That being said, if you wish to contribute a patch, please feel free to do so, we will be happy to merge it! :slightly_smiling_face:


Thanks, that’s all very useful info. I agree it looks like it would be very easy to add hg support the way you have designed it. I’m just getting started with this, so need to play around and get a feel for how it works. I can use Git for now. Perhaps a patch some day, but I think you’ll probably beat me to it.

1 Like

No worries :slight_smile: Thank you for trying out dvc!


For the record - no plans to support Mercurial anymore since its share is marginally small and we don’t want to support code that is not used by majority of the community.

1 Like