# irepo **Repository Path**: ipetrov/irepo ## Basic Information - **Project Name**: irepo - **Description**: Tool for working with multi git repositories as one project - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2023-04-05 - **Last Updated**: 2025-04-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # irepo Tool for working with multi git repositories as one project. * [Requirenments](docs/requirenments.md) * [Changelog](CHANGELOG.md) * [Manifest format](docs/manifest.md) * [Tests](docs/tests.md) ## How to install and uninstall irepo ```bash cd irepo ./install_irepo.sh # Restart terminal session for tab-completions helping ``` ```bash cd irepo ./uninstall_irepo.sh ``` ## irepo usage example ark repo (ohos) in standalone mode ```bash cd ohos_root_fake_directory # you can use another name # -------------------------------------------------- # NB! If you also want to pretty use your repository forks of new repositories (--gitee-user-profile-name=) # Please rename old name and path of your forks arkcompiler_runtime_core and ets_frontend SIG git repositories # in gitee repository settings. SIG and OHOS repository names are same, so irepo can use your old forks # in '--gitee-user-profile-name=your_profile_name' option and fetch your old remotes # Your OHOS forks must be next: # OHOS YOUR FORK # https://gitee.com/openharmony/arkcompiler_runtime_core.git -> https://gitee.com/your_name_in_gitee/arkcompiler_runtime_core.git # https://gitee.com/openharmony/arkcompiler_ets_frontend.git -> https://gitee.com/your_name_in_gitee/arkcompiler_ets_frontend.git # !! ecmascript plugin stiil places in SIG repository, no need to change !! # SIG YOUR FORK # https://gitee.com/openharmony-sig/arkcompiler_ets_runtime.git -> https://gitee.com/your_name_in_gitee/arkcompiler_ets_runtime.git # It helps you for pretty work with 2 remotes (openharmony and your) # --------------------------------------------------------------------- # 'arkcompiler' is same name as in ohos root (you can use another name) # link files automatically created during download commands # See download and others commands descriptions below irepo download -u https://gitee.com/ipetrov/irepo_ark_manifest.git \ -m arkcompiler-ohos.xml \ --gitee-user-profile-name=ipetrov \ arkcompiler cd arkcompiler irepo info # info about each repository cd runtime_core/static_core && ./scripts/install-third-party # Be happy and use irepo in ark development :) irepo status # current git status for each repository # irepo update, etc irepo commands ``` ## irepo commands Common uasge: ``` irepo [flags] [command_options] ``` ### flags + `-h`, `--help` - print help info about irepo flags and commands + `--version` - print current installed irepo version + `--gitee-only` - run irepo command only for gitee repositories + `--no-gitee-only` - run command only for repositories no from gitee + `-r PATTERN` - run command only for repository names matching PATTERN (like `grep -E`) ### Commands #### **download** ``` irepo download [options] ``` Download repositories into `project_root_dir`. If the directory is not empty then clear it. If `project_root_dir` does not exist then create it. Create irepo local config into `.vscode/.irepo`. | `download` option | description | |:-----|------| | `-h`, `--help`| print help info about `download` command | | `--gitee-user-profile-name=`
(Deprecated) | add gitee user (with profile name `user_name`) forks for gitee repositories as additional remote url
(https://gitee.com/${user_name}/some_repo.git, etc.) | | `--gitee-user-remote-name=`
(Deprecated) | set remote name `remote_name` for gitee user repository forks
Default: same as value in `--gitee-user-profile-name`| | `--gitee-user-disallow-pushing`
(Deprecated) | set `no_push_allowed` value to push-url for gitee user remotes | | `--gitee-user-url-remote-format=(ssh or https)`
(Deprecated) | use specific url format for gitee user remotes (`ssh` or `https`)
Default: for each repository use url format same as url format in manifest for the repository | | `-u `,
`--url ` | manifest git repository url for download config
Default: https://gitee.com/ipetrov/irepo_ark_manifest.git | | `-m `,
`--manifest ` | name of manifest xml-file
Default: `default.xml` | | `-b `,
`--branch `| branch in manifest git repository
Default: master | `irepo` project internal files place in `.vscode/.irepo` from project root directory (because `.gitignore` usually has `.vscode`, can be changed in future) #### **init** ``` irepo init [options] ``` Initialize current directory for `irepo` with already existed local git repositories. Create local irepo config with according manifest into `.vscode/.irepo`. | `init` option | description | |:-----|------| | `-h`, `--help`| print help info about `init` command | | `-u `,
`--url ` | manifest git repository url for irepo local config | | `-m `,
`--manifest ` | name of manifest xml-file
Default: `default.xml` | | `-b `,
`--branch `| branch in manifest git repository
Default: master | | `--retry N` | count of attemp to clone/fetch each repository from manifest
Default: 3 | | `--main-gitee-remote=` | change main remote name from manifest to `main_remote_name` | | `--user-gitee-profile=`
(Deprecated) | set user gitee profile name to `user_gitee_name`
(`https://gitee.com/${user_gitee_name}`) | | `--user-gitee-remote=`
(Deprecated) | change user remote name to `user_remote_name`
(it's name for git commands: `remote`, `pull`, `fetch`, `push`, etc).
Will be set same as `user_gitee_name` if the option was not set and `--user-gitee-profile` option was set | #### **help** ``` irepo help [-h | --help ] [COMMAND]... ``` List information about irepo `COMMAND`s (all irepo commands by default). #### **info** ``` irepo info [options] ``` Without options print detail info about current state of repositories. With option print choosen info (see options) | `info` option | description | |:-----|------| | `-h`, `--help`| print help info about `info` command | | `--url` | print main repository url | | `--path` | print full path to repository | | `--revision` | print detail current revision info | | `--branch` | print current branch | | `--local-branches` | print all local branches list | | `--remotes` | print remote names list | | `--config` | print current config for repositories
(helpful for `irepo reconfig`) | #### status ``` irepo status [-h | --help] ``` Print git status about repositories: commit, changes | `status` option | description | |:-----|------| | `-h`, `--help`| print help info about `status` command | | `-s`, `--short` | print info only about existing changes in repositories | #### **update** ``` irepo update [options] ``` Update all repositories: fetch all remotes, update local manifest revision to freshest version. By default, current branches don't update (stay on current revision). | `update` option | description | |:-----|------| | `-h`, `--help`| print help info about `update` command | | `-r`, `--rebase` | rebase current branches onto fresh manifest revision | | `--push-gitee-user`
(Deprecated) | need to push freshest manifest revision to user fork repository
(`--gitee-user-remote-name=` argument in `download` command) | | `-j N` | run updating in N jobs parallely (0 means default value usage)
Default: count of repositories for updating | | `--retry M` | count of git command (fetch/push) attemps
Default: 3 | #### **branch** ``` irepo branch [options] ``` Without options try to checkout all repositories to 'branch_name'. If branch does not exist in repository then stay on current revision. | `branch` option | description | |:-----|------| | `-h`, `--help`| print help info about `branch` command | | `-r`, `--rebase` | rebase onto manifest revision after checkout to `branch_name` | | `-cm`, `--checkout-manifest` | checkout to manifest revision in repositories that don't have `branch_name` | | `-f`, `--force` | force checkout to `branch_name`. If couldn't checkout then restore tracked changes and try to checkout again. If couldn't checkout after restoring of tracked changes then clean untracked files and try to checkout again | | `-d`, `--delete` | delete local branch `branch_name` from repositories which contain this branch | | `-D` | force delete local branch `branch_name` from all repositories | | `--use-remote` | use remote versions of branch `branch_name` if it exists (remove local version before it)
If remote branch does not exist, try to use local version
(ignore for manifest revision branch) | | `--first-before-date=''`
(Deprecated) | checkout to first commit before `committer_date` (incl.)
(use git commiter date format. example: `git log -1 --format='%cd'`)
in manifest revision and create new local branch with name `branch_name`.
Ignore others options except `-f, --force` | #### **patch** ``` irepo patch [options] branch_name ``` Commit all (staged, unstaged, untracked) changes to branch `branch_name`. If branch `branch_name` does not exist than create it, checkout to it otherwise. By default, add new commit to branch `branch_name` and use `-s` (`--signoff`) commit option | `patch` option | description | |:-----|------| | `-h`, `--help`| print help info about `patch` command | | `--amend` | amend previous commit in branch `branch_name` (if branch exists) | | `-m "Commit masseage"`
`--message "Commit masseage"` | checkout to `` in revision manifest git repository | #### **rebase** ```bash irepo rebase [-h | --help] [branch] ``` Rebase current branches in all repos onto `branch`. If `branch` is not specified then manifest revision is used. If `branch` does not exist in a repository, then it does nothing in the repository. If current branch is manifest revision in a repository, so don't rebase onto `branch` in the repository. #### **push** ``` irepo push [options] ``` Push branch `branch_name` to remote. | `push` option | description | |:-----|------| | `-h`, `--help`| print help info about `push` command | | `-u ` | set `remote_name` as upstream for `branch_name` | | `--gitee-remote `
(Deprecated) | for gitee repositories use `gitee_remote` as upstream for `branch_name` | | `-f`, `--force` | use force pushing for `branch_name` | | `--retry N` | attempts count of pushing.
Default: 2 | #### **git** ``` irepo git [git_options | -h | --help] ``` Run git command with options for each repositories. If command `git [git_options]` fails for any repository then `git` command failed at the end. #### **forall** ```bash irepo forall [options] -c " [command_options]" ``` Run bash `command [command_options]` for all repositories. If `command [command_options]` fails for any repository then it does not stop the command for others repositories. By default, `forall` command fails at the end if `command [command_options]` fails for any repository. | `forall` option | description | |:-----|------| | `-h`, `--help`| print help info about `forall` command | | `--no-fail` | `forall` command will not fail if the `command [command_options]` fails for any repository | | `-j N` | run `command [command_options]` in N jobs (0 means count of processing repositories)
Default: 1 | #### **revision** ``` irepo revision [options] .xml ``` Checkout repositories (all or subset) to according commits or branches from `.xml`. By default, try to find `.xml` locally. Use `--url` options to download from remote git repository. | `revision` option | description | |:-----|------| | `-h`, `--help`| print help info about `revision` command | | `-u `,
`--url ` | revision manifest git repository url | | `-c `,
`--commit ` | checkout to `` in revision manifest git repository | | `-s`, `--save`| save current revision state (commit hash) to `.xml`. Ignore others options | #### **add_gitee_user** (Deprecated) ``` irepo add_gitee_user [options] ``` Add remote name with urls to all gitee repositories (ignore `-r` irepo parameter). It looks like: ```bash git remote add ${remote_name} https://gitee.com/${name}/some_repo.git git remote add ${remote_name} https://gitee.com/${name}/another_repo.git git remote add ${remote_name} https://gitee.com/${name}/yet_another_repo.git ``` | `add_gitee_user` option | description | |:-----|------| | `-h`, `--help`| print help info about `add_gitee_user` command | | `--try-fetch` | try to fetch from new added user remote (`git fetch name`) | | `--remote-name=` | remote name for `git remote` command. Default is same as `name` argumnet | | `--disallow-pushing` | set `no_push_allowed` value to push-url for new user remote | | `--url-remote-format=(ssh or https)` | use specific url format for gitee user remotes (`ssh` or `https`)
Default: for each gitee repository use url format same as url format in manifest for the repository | #### **reconfig** ``` irepo reconfig [options] ``` Reconfig local repository settings. Need for local projects after upgrade irepo version. Also can be used for change main and user gitee remotes. | `reconfig` option | description | |:-----|------| | `-h`, `--help`| print help info about `reconfig` command | | `--main-gitee-remote=` | change main remote name from manifest to `main_remote_name`
If the option is not set then will be used from current local config | | `--user-gitee-profile=` | set user gitee profile name to `user_gitee_name`
(`https://gitee.com/${user_gitee_name}`)
If the option is not set then will be used from current local config | | `--user-gitee-remote=` | change user remote name to `user_remote_name`.
If the option is not set then will be used from current local config.
If couldn't detect from the current local then will be set same as `user_gitee_name` | | `--user-gitee-disallow-pushing` | set `no_push_allowed` value to push-url for gitee user remotes | | `--user-gitee-url-remote-format=(ssh or https)` | use specific url format for gitee user remotes (`ssh` or `https`)
Default: for each repository use url format same as url format in manifest for the repository | #### **upgrade** ``` irepo upgrade [-h | --help] ``` Upgrade current irepo version to freshest. After upgrade you need to reconfig local project irepo configuration via `irepo reconfig`. ## Returned irepo codes | Code | Description | |:---:|------| | 0 | Success | | 1 | System command failed (like `cp`, `cd`, etc) | | 2 | `irepo` usage failed (incorrect argument, incorrect command usage, etc) | | 3 | `git` command in `irepo` failed for local state usage (`checkout`, `rebase`, etc) | | 4 | `git` command in `irepo` failed for remote state usage (`push`, `pull`, etc) | | 5 | `irepo` internal critical error |