How to list my commits in multi projects that are managed by google repo command

Viewed 17

I have multi projects that are managed by google repo command. I work in multi projects. Sometimes I want to list my commits and review their content in multi projects. How to do that? Any command? I can not enter into the project dirs manually and use the "git log" one by one because the projects are too many to remember.

1 Answers

You could use repo forall. It executes the given shell command in each project. And you could use -r to filter the projects in regular expressions.

For example, to list the latest 3 commits in oneline format, in the repositories whose paths start with packages/apps/ or build/, and use the pager less.

repo forall -p -r '^packages/apps/.+' -r '^build/.+' -c 'echo $REPO_PROJECT;git log --oneline -3' | less

Note that if you use environment variables like REPO_PROJECT in the shell command, use the single quotes '' instead of the double quotes "" to wrap the command. The latter makes the environment variables disabled.

Related