首页 > 代码库 > Repo on Ubuntu

Repo on Ubuntu

Android是由Kernel、Dalvik、Bionic、Prebuilt、build等多个Git项目组成,如果我们分别使用Ubuntu Git命令来逐个获取显得非常麻烦,所以Android项目组编写了一个名为Repo的Python脚本来统一管理这些项目仓库,使得项目的获取更加简单。

 

(1)安装Curl工具:

 

        sudo apt-get install curl

 

(2)下载Repo脚本:

 

        curl http://android.git.kernel.org/repo >~/bin/repo

 

(3)Repo脚本授权:

 

        chmod a+x ~/bin/repo

 

(4)下载trunk源码:

 

        repo init -u git://android.git.kernel.org/platform/manifest.git

 

(5)下载branch源码:

 

        repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake

 

(6)查看repo帮助:

 

        repo或repo help

 

(7)同步代码:

 

        repo sync

 

(8)比较文件不同:

 

        repo diff 文件名

 

(9)显示文件状态:

 

        repo status