repo 使用小结

切分支

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,同时还输出了当前代码所在分支

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容