Skip to content

Clone Repository

Cloning an ml-git repository

This notebook describes how to clone an ML-Git repository.

Notebook state management

If you have already run this notebook or another notebook in this same folder, it is recommended that you execute the cell below to clean the environment, as state changes made previously may interfere with the notebook running. Be aware that this procedure does not affect any remote repositories.

!sh ./clean_environment.sh

To start using the ml-git api we need to import it into our script

from ml_git.api import MLGitAPI

After importing you can use the api clone method, passing the url of the git repository as a parameter.

repository_url = '/local_ml_git_config_server.git'
api = MLGitAPI()

api.clone(repository_url)
INFO - Metadata Manager: Metadata init [/local_server.git/] @ [/api_scripts/tmprr5gsm40/mlgit/.ml-git/datasets/metadata]
INFO - Metadata Manager: Metadata init [/local_server.git/] @ [/api_scripts/tmprr5gsm40/mlgit/.ml-git/models/metadata]
INFO - Metadata Manager: Metadata init [/local_server.git/] @ [/api_scripts/tmprr5gsm40/mlgit/.ml-git/labels/metadata]
INFO - Metadata: Successfully loaded configuration files!

When the clone is successfully completed, the entities are initialized and ready for use.


Last update: October 3, 2023