repo 命令

repo命令是Google开发的用于管理Android版本库的一个工具。
repo命令并不是用于取代git,而是用Python对git进行了一定的封装,简化了对多个Git版本库的管理。

  • repo init -u -b -m

  • repo sync
    相当于 git clone 获取 git remote update ; git rebase origin/branch
    选项:
    * -c: 只从服务器端获取当前分支
    * -d: 分离头指针状态,切换到指定提交,丢弃工作区修改
    * -f: 即使某个项目失败,也同步其他的
    * -n: 只网络操作 git fetch
    * -l: 只本地操作 git checkout
    * -j : 并发数

  • repo download [options] /
    默认使用checkout检出
    选项:
    -c: 使用cherry-pick 命令检出
    -r: 撤销评审的提交

  • repo forall [project-list] -c command
    选项 :
    -c: 要运行的命令和参数
    -e: 一个命令失败,全部失败
    -p: 在输出结果之前显示项目标头
    -r : 正则匹配到的项目执行
    -i : 正则没有匹配到的项目执行

    例子: repo forall -pc git rest --hard; git clean -fdx

你可能感兴趣的:(repo)