ubuntu
$ sudo apt-get install repo
清华源
# curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o repo
# chmod +x repo
$ mkdir -p ~/.bin
$ PATH="${HOME}/.bin:${PATH}"
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
$ chmod a+rx ~/.bin/repo
repo工具库
# git clone https://gerrit.googlesource.com/git-repo
repo 命令使用
使用帮助
Usage: repo [-p|--paginate|--no-pager] COMMAND [ARGS]
Options:
-h, --help show this help message and exit
--help-all show this help message with all subcommands and exit
-p, --paginate display command output in the pager
--no-pager disable the pager
--color=COLOR control color usage: auto, always, never
--trace trace git command execution (REPO_TRACE=1)
--trace-to-stderr trace outputs go to stderr in addition to
.repo/TRACE_FILE
--trace-python trace python command execution
--time time repo command execution
--version display this version of repo
--show-toplevel display the path of the top-level directory of the
repo client checkout
--event-log=EVENT_LOG
filename of event log to append timeline to
--git-trace2-event-log=GIT_TRACE2_EVENT_LOG
directory to write git trace2 event log to
--submanifest-path=REL_PATH
submanifest path
The most commonly used repo commands are:
abandon Permanently abandon a development branch
branch View current topic branches
branches View current topic branches
checkout Checkout a branch for development
cherry-pick Cherry-pick a change.
diff Show changes between commit and working tree
diffmanifests Manifest diff utility
download Download and checkout a change
gitc-delete Delete a GITC Client.
gitc-init Initialize a GITC Client.
grep Print lines matching a pattern
info Get info on the manifest branch, current branch or unmerged branches
init Initialize a repo client checkout in the current directory
list List projects and their associated directories
overview Display overview of unmerged project branches
prune Prune (delete) already merged topics
rebase Rebase local branches on upstream branch
smartsync Update working tree to the latest known good revision
stage Stage file(s) for commit
start Start a new branch for development
status Show the working tree status
sync Update working tree to the latest revision
upload Upload changes for code review
See 'repo help <command>' for more information on a specific command.
See 'repo help --all' for a complete list of recognized commands.
Bug reports: https://bugs.chromium.org/p/gerrit/issues/entry?template=Repo+tool+issue
同步整个工程
repo sync
同步指定工程
repo sync project1 .....
创建分支
repo start branch_name
查看工程状态
repo status
查看当前所有工程分支
repo branch
查看是否有未合并的分支
repo overview
参考文档
https://gerrit.googlesource.com/git-repo