擷取Android源碼

來源:互聯網
上載者:User

Git是Linux Torvalds為了協助管理Linux核心開發而開發的一個開放源碼的公布式版本控制軟體。在Git版本控制系統中,每一個工作目錄都包含一個完整倉庫,它們支援離線工作。

 

Android是由kernel、Dalvik、Bionic、build等多個Git項目組成的,所以Android項目編寫了一個名為Repo的Python指令碼來統一管理這些項目的倉庫。

 

(1)安裝Git

$ sudo apt-get install git-core curl

 

(2)安裝Repo

$ mkdir ~/bin

把~/bin添加到PATH變數

 

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

$ chmod +x ~/bin/repo

 

(3)初始化版本庫

$ mkdir ~/android

$ cd ~/android

 

 

# 擷取最新的源碼庫

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

 

 

#擷取某個branch的源碼

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

 

 

#只需要擷取某一個project的源碼

$ git clone git://android.git.kernel.org/kernel/common.git

 

(4)同步版本庫

#同步幾個項目

$ repo sync project1 project2 ……

 

#同步單個目錄

$ cd project

$ git pull

 

 (5)擷取android linux kernel源碼

$ cd ~/android

$ git clone git://android.git.kernel.org/kernel/common.git android-kernel

$ cd android-kernel

$ git checkout --track -b android-2.6.32 origin/android-2.6.32

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.