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.
monoceros add-repo <name> <url> [--path=<dir>] [--provider=<p>] \ [--git-name=<name> --git-email=<email>]Examples
Section titled “Examples”Clone into projects/api/ (the default folder, derived from the URL):
monoceros add-repo acme https://github.com/acme/api.gitClone into a nested destination:
monoceros add-repo acme https://github.com/acme/web.git --path=apps/webName the provider for a self-hosted host Monoceros can’t auto-detect:
monoceros add-repo acme https://git.acme.corp/team/api.git --provider=gitlabCommit as a different identity for this repo only:
monoceros add-repo acme https://github.com/acme/api.git \ --git-name="Jane Work" --git-email=jane@acme.exampleOptions
Section titled “Options”| Flag | Description |
|---|---|
--path=<dir> | Destination under projects/; subfolders via / (e.g. apps/web). Defaults to a segment derived from the URL (api.git → api). |
--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. |
Behavior
Section titled “Behavior”- 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.
See also
Section titled “See also”- Git and repositories - cloning, HTTPS auth and commit identity in full.
monoceros remove-repo- the inverse.