2

I have tried googling this but havent found anything relavant to what im looking for. I have a few projects in android that i have rebased to the tip. After doing that I would like to move all the remaining projects to the tip.

The below command will checkout all the projects to the tag. repo forall -c "git checkout "

I would like to skip the ones that i have rebased manually.

Appreciate your help. Thanks!

4

2 回答 2

6

您可以指定该repo forall命令应应用于哪些项目,但无法表达“除了这N个项目之外的所有项目”(除非您可以使用正则表达式表达您希望它应用于的项目,但这不太可能)。

您可以做的是生成所有项目的列表,例如

repo forall -c 'echo $REPO_PROJECT'

并删除您已重新定位并希望排除的项目,例如通过管道输出grep -v或将输出重定向到文件并手动编辑该文件。然后将该项目列表提供给repo forall. 两个例子:

repo forall -c 'echo $REPO_PROJECT' > projects
vi projects
repo forall $(cat projects) -c 'git checkout'

repo forall $(repo forall -c 'echo $REPO_PROJECT' | grep -v name/of/project) -c 'git checkout'
于 2015-02-24T06:43:29.390 回答
3

使用-i-r。IErepo forall -i bypass git fetch

-r, --regex           Execute the command only on projects matching regex or
                    wildcard expression
-i, --inverse-regex   Execute the command only on projects not matching
                    regex or wildcard expression
于 2018-07-27T06:35:30.457 回答