repo 使用小结

2016-12-23  本文已影响0人  王小宝wy

切分支

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

上一篇下一篇

猜你喜欢

热点阅读