The init command scans your local filesystem for Git repositories and
generates a repos.yaml file from them.
repos init [OPTIONS]This command is the easiest way to get started with repos. Instead of writing
a repos.yaml file by hand, you can clone your repositories into a directory
and then run repos init to automatically generate the configuration. It will
discover all Git repositories in the current directory and its subdirectories.
-o, --output <OUTPUT>: Specifies the name of the output configuration file. Defaults torepos.yaml.--overwrite: If a configuration file already exists at the output path, this flag allowsreposto overwrite it.--supplement: If a configuration file already exists, this flag will add newly discovered repositories to the existing file without removing the ones that are already there.-h, --help: Prints help information.
First, clone some repositories, then run init.
mkdir my-projects
cd my-projects
git clone https://github.com/owner/project-one.git
git clone https://github.com/owner/project-two.git
repos initThis will create a repos.yaml file in the my-projects directory.
repos init --output my-company-repos.yamlrepos init --overwriteIf you have an existing repos.yaml and have cloned new repositories, you can
add them without losing your existing configuration (including tags, custom
paths, etc.).
# repos.yaml already exists
git clone https://github.com/owner/new-project.git
repos init --supplement