e repository by running the following CLI command:zenml code-repository register <NAME> --type=github \

--url=<GITHUB_URL> --owner=<OWNER> --repository=<REPOSITORY> \

--token=<GITHUB_TOKEN>

where <REPOSITORY> is the name of the code repository you are registering, <OWNER> is the owner of the repository, <NAME> is the name of the repository, <GITHUB_TOKEN> is your GitHub Personal Access Token and <GITHUB_URL> is the URL of the GitHub instance which defaults to https://github.com. You will need to set a URL if you are using GitHub Enterprise.

After registering the GitHub code repository, ZenML will automatically detect if your source files are being tracked by GitHub and store the commit hash for each pipeline run.

Go to your GitHub account settings and click on Developer settings.

Select "Personal access tokens" and click on "Generate new token".

Give your token a name and a description.

We recommend selecting the specific repository and then giving contents read-only access.

Click on "Generate token" and copy the token to a safe place.

GitLab

ZenML also provides built-in support for using GitLab as a code repository for your ZenML pipelines. You can register a GitLab code repository by providing the URL of the GitLab project, the group of the project, the name of the project, and a GitLab Personal Access Token (PAT) with access to the project.

Before registering the code repository, first, you have to install the corresponding integration:

zenml integration install gitlab

Afterward, you can register a GitLab code repository by running the following CLI command:

zenml code-repository register <NAME> --type=gitlab \

--url=<GITLAB_URL> --group=<GROUP> --project=<PROJECT> \

--token=<GITLAB_TOKEN>