# add

## Description

* Add a Cauldron repository to the local collection of Cauldron repositories &#x20;

## Syntax

`ern cauldron repo add <alias> <url>`

**Arguments**

`<alias>`

* Alias to associate to the cauldron repository.

`<url>`

* Local or remote url to the Cauldron git repository to add.&#x20;
* A remote url can be the HTTPS or SSH url to the Cauldron git repository (SSH recommended).
* A local url can be any valid path to a local directory (empty directory or containing a git repository).
* For HTTPS urls, the username and password (or token) must be specified in the URL (valid formats are `https://[username]:[password]@[repourl` or `https://[token]@[repourl]`).
* By default, the `master` branch of the repository will be used. If you need to use a different branch, you can set the branch name you want to use, by appending it at the end of the url using the `#[branch-name]` format (second example below illustrate this).

**Options**

`--current true|false`

* Set the repository as the active repository after adding it to the collection of repositories. &#x20;
* If this option is not provided, you are prompted to choose if you want to set the repository as the active repository. &#x20;

**Example**

`ern cauldron repo add my-cauldron git@github.com:User/Cauldron.git`\
Add a new Cauldron repository, with alias `my-cauldron`, and url `git@github.com:User/Cauldron.git`, to the local collection of Cauldron repositories. The branch that will be used for this Cauldron will be `master` as no branch was explicitly specified.

`ern cauldron repo add my-local-cauldron ~/path/to/local/cauldron`\
Add a new Cauldron repository with alias `my-local-cauldron` and url pointing to local directory `~/path/to/local/cauldron` to the location collection of Cauldron repositories.

`ern cauldron repo add my-other-cauldron git@github.com:User/OtherCauldron#development --current`\
Add a new Cauldron repository, with alias `my-other-cauldron`, and url `git@github.com:User/OtherCauldron`, to the local collection of Cauldron repositories and set it at the current activated Cauldron. The branch that will be used for this Cauldron will be `development` as it was explicitly specified in the Cauldron url.

## Remarks

* If the `alias` already exists, this command will fail.
