Google git-repo (Repo)工具简介

来源:互联网 发布:淘宝企业店铺介绍范文 编辑:程序博客网 时间:2024/05/22 09:50
git-repo简称Repo,是基于Git的一款工具,可以管理多个Git库,从而使开发流程的自动化。
repo命令其实是一个Python2脚本(目前不兼容Python3)。
1.安装
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
2.设置访问Git库的参数
git config --global user.email "you@example.com"
git config --global user.name "Your Name"

3.初始化本地库

以Android的master分支初始化:

repo init -u https://android.googlesource.com/platform/manifest
以Android的4.0.1_r1分支初始化:
repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
4.下载代码到本地库
repo sync
repo sync a_specific_project another_specific_project
5.上传更新(上传之前先repo sync)
repo upload
6.创建新的分支
repo start branch_name
7.查看库状态
repo branches
repo status
8.查看帮助
repo help

repo help init

参考链接:

https://code.google.com/p/git-repo/
git clone https://gerrit.googlesource.com/git-repo


1 0