Skip to content

monoceros add-repo

Registers a Git repository (HTTPS) to clone into the workspace. It is cloned into projects/<path>/ on the next monoceros apply, so the code is already there when you open the container.

Terminal window
monoceros add-repo <name> <url> [--path=<dir>] [--provider=<p>] \
[--git-name=<name> --git-email=<email>]

Clone into projects/api/ (the default folder, derived from the URL):

Terminal window
monoceros add-repo acme https://github.com/acme/api.git

Clone into a nested destination:

Terminal window
monoceros add-repo acme https://github.com/acme/web.git --path=apps/web

Name the provider for a self-hosted host Monoceros can’t auto-detect:

Terminal window
monoceros add-repo acme https://git.acme.corp/team/api.git --provider=gitlab

Commit as a different identity for this repo only:

Terminal window
monoceros add-repo acme https://github.com/acme/api.git \
--git-name="Jane Work" --git-email=jane@acme.example
FlagDescription
--path=<dir>Destination under projects/; subfolders via / (e.g. apps/web). Defaults to a segment derived from the URL (api.gitapi).
--provider=<github|gitlab|bitbucket>The repo’s Git provider, so Monoceros knows which token to use. Required for non-canonical hosts (not github.com / gitlab.com / bitbucket.org); auto-detected otherwise.
--git-name=<name> / --git-email=<email>Per-repo committer identity, overriding the container-level git.user. Use both together.
  • Idempotent. An already-cloned folder under projects/ is skipped, never re-cloned or overwritten - so re-applying is safe.
  • Adds the provider CLI. For a GitHub or GitLab repo, the matching CLI feature (gh / glab) is added too, authenticated from the same token.
  • Clones when it can. If the container is already running, the repo is cloned into it right away; otherwise on the next monoceros apply. Either way the yml is updated now.
  • Needs a token for private repos. The clone authenticates with your access token; without one, a private repo fails with an auth error. Set the token first - see Git and repositories.