The repo traverses all git repositories:
repo forall -c command
Among them, the parameters are:
-
-c: any shell commands that can be supported by the system (ls, cp, pwd, etc.)
-
-p: List project names before shell command output
-
-v: List the error information output by executing the shell command
The command can also add environment variables:
The parameters of environment variables are as follows:
REPO_PROJECT: Specify the name of the project
REPO_PATH: Specify the relative path of the project in the workspace
REPO_REMOTE: Specify the name of the remote warehouse of the project
REPO_LREV: Specifies the hash value corresponding to the last submission of the project to the server warehouse
REPO_RREV: Specify the specified branch of the project when it is cloned, the revision attribute in the manifest
If the shell command after -c is the above-mentioned environment variable, you need to enclose the shell command in single quotes.
Example:
repo forall –c ‘echo $REPO_PROJECT’
repo forall -p -c git branch -vv //View the branches of all warehouses
repo forall -p -c git log --grep "XXX" //Only display submissions containing the specified keyword XXX