切分支
repo start <branch-name> <module-name>
比如:
repo start develop art/runtime
这条命令相当于给art/runtime
这个模块执行git checkout -b develop
执行shell命令
repo forall <module-name> -c <shell-command>
比较常见的使用情形是执行git
命令(在源码根目录下):
repo forall packages/app/Contacts -c git status
repo forall packages/app/Contacts -c git add -A
...
查看git状态
repo forall packages/app/Contacts -c git status
用这种方式可以查看一个模块的git状态,命令的输出是标准的git输出格式:
On branch develop
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: runtime/native/dalvik_system_DexFile.cc
modified: runtime/native/java_lang_Class.cc
no changes added to commit (use "git add" and/or "git commit -a")
repo
本身也提供一种更简洁的查看状态的命令:
repo status art/runtime
这种方式的输出也更加简洁直观:
project art/ branch develop
-m runtime/native/dalvik_system_DexFile.cc
-m runtime/native/java_lang_Class.cc
-m
就相当于modified
,同时还输出了当前代码所在分支