All repo command



Allrepo command

1.        abandon

Permanentlyabandon a development branch

废弃本地分支及其历史 等同于git branch -Dbranchname  option

Usage:repo abandon <branchname> [<project>...]

2.        branch

Viewcurrent topic branches

Usage:repo branches [<project>...]

查看当前分支,无option

3.        branches    

Viewcurrent topic branches

同上

4.        checkout

    Checkout a branch for development

Usage:repo checkout <branchname> [<project>...]

切换到本地其他分支 option ,repo forall[<project>...] -c git checkout <branchname>

5.        cherry-pick

 Cherry-pick a change.

Usage:repo cherry-pick <sha1>

拣选变更到分支,无option

6.        diff 

       Show changes between commit and workingtree

Usage:repo diff [<project>...]

查看上次提交和工作目录之间的差别 ,无option

7.        download

  Download and checkout a change

Usage:repo download {project change[/patchset]}...

从评审系统下载一个变更到工作目录

8.        forall 

Run a shell command in each project

Usage:repo forall [<project>...] -c <command> [<arg>...]

遍利项目执行一个shell命令

Option

-c 要执行的shell命令

-p 输出执行结果前,输出项目名称,如果没有继承终端标准输入输出

-v显示执行错误信息,

环境变量

REPO_PROJECT:项目名称

REPO_PATH项目相对于根目录的路径

REPO_REMOTE远程系统中的名称,及在manifest中定义的名称

REPO_LREV  manifest中版本名称,转换成本低跟踪分支,如果你需要把manifest版本传导本地git命令中时可以使用

REPO_RREV  manifest中定义的版本名称和mainifest中写的完全一致

9.        grep       

Print lines matching a pattern

Usage: repo grep {pattern | -e pattern}[<project>...]

10.    help      

Displaydetailed help on a command

Usage:repo help [--all|command]

显示命令的帮助

11.    init     

Initializerepo in the current directory

Usage:repo init [options]

初始化repo

-q,--quiet     log信息

-u URL,--manifest-url=URL   manifest 库地址

-bREVISION, --manifest-branch=REVISION manifest库版本通常指分支

-mNAME.xml, --manifest-name=NAME.xml 要使用manifest库中xml文件名

--mirror            镜像库mirror the forrest

--reference=DIR      镜像的目录locationof mirror directory

--depth=DEPTH       影子克隆深度,同git clone中选项

--repo-url=URL      初始化时使用repo库的地址reporepository location

--repo-branch=REVISION初始化时使用repo库的版本或分支repobranch or revision

--no-repo-verify     不验证 repo的版本源 do notverify repo source code

`repoinit -b otherbranch`可以改变manifest库的分支,但需要运行repo sync -d

12.    list  

Listprojects and their associated directories

Usage:repo list [<project>...]

列出项目名和路径 等于:repo forall -c'echo "$REPO_PATH :$REPO_PROJECT"' option

13.    manifest 

Manifestinspection utility

Usage:repo manifest [-o {-|NAME.xml} [-r]]

生成

-r,--revision-as-HEAD 生成版本Save revisions as current HEAD

-o-|NAME.xml, --output-file=-|NAME.xml   生成到终端 或者xml的名称

14.    prune

Prune(delete) already merged topics

Usage:repo prune [<project>...]

删除已经merger的分支 option

15.    rebase

Rebaselocal branches on upstream branch

16.    selfupdate  

Updaterepo to the latest version

Usage:repo selfupdate

更新repo 本身的版本,通常reposync 时会自动同步

17.    smartsync

Updateworking tree to the latest known good revision

reposmartsync [<project>...]

这个命令是repo sync -s的快捷方式其他选项同repo sync

18.    stage   

Stagefile(s) for commit

Usage:repo stage -i [<project>...]

准备演示下次要提交的内容,-i 指交互界面同git add命令中的--interactive

19.    start

Start anew branch for development

Usage:repo start <newbranchname> [--all | <project>...]

manifest中版本的基础上建立一个开发分支

--all 给所有的分支

20.    status

Show theworking tree status

Usage:repo status [<project>...]

显示工作目录版本

-j 同时处理项目的数量

 

第一列显示暂存区和 上次提交的区别,通常大写,意义如下:

 -:  nodifference

 A: added         (not in HEAD,     in index                     )

 M: modified      (    in HEAD,    in index, different content  )

 D: deleted       (    in HEAD, not in index                     )

 R: renamed       (not in HEAD,     in index, path changed       )

 C: copied        (not in HEAD,     in index, copied from another)

 T:  modechanged  (    in HEAD,    in index, same content       )

 U: unmerged; conflict resolution required

 

第二列显示工作区和暂存区的区别,通常小写,意义如下:

 -:  new/ unknown (not in index,     in worktree                )

 m: modified      (    in index,     in work tree, modified      )

 d: deleted       (    in index, not in work tree             

21.    ***sync 

Updateworking tree to the latest revision

Usage:repo sync [<project>...]

更新版本树到最新版本

  -f, --force-broken    某个项目失败之后还是继续同步

  -l, --local-only      只是更新本地工作目录不从远程获取更新

  -n, --network-only   只更新远程到版本库,不更新工作目录

  -d, --detach          detach projects back to manifestrevision

  -q, --quiet          不显示log信息

  -j JOBS, --jobs=JOBS  同时处理项目数量

  -s, --smart-sync      职能化同步smart sync usingmanifest from a known good build

22.    *upload

Uploadchanges for code review

上传变更到代码评审服务器

-t                    把本地分支名也提交到服务器

--re=REVIEWERS,--reviewers=REVIEWERS  请求下面帐户审核

--cc=CC               抄送下面的邮件列表

--br=BRANCH           要提交到代码服务器的本地分支

--no-verify           Do not run the upload hook.

--verify              不提示运行upload 钩子脚本Run theupload hook without prompting.

23.    version

Displaythe version of repo

Usage:repo version

显示repo版本,实际测试过程还会显示gitpython gcc的版本号

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值