android 快速簡倉方法

來源:互聯網
上載者:User

android 快速簡倉方法

1、簡易建倉--使用git倉庫的work tree 形式

項目開發中經常遇到需要共用android源碼的情況,一種方法是通過tar打套件共用。由於android源碼使用manifest 倉庫來管理,因此通過分析和修改manifest 檔案可以快速建立一個倉庫。

git clone manifest.git

cd manifest

分析default.xml檔案,

主要修改

注意ssh://本機ip/name 應該能定址到git倉庫

 

git add .

git commit -m " initial change"

git push origin master:master

即可快速修改manifest.git

 

然後通過repo init -u ssh://myname@ip/relativepatch/manifest.git 路徑通知同事下載。

注意使用私人伺服器ssh,需要在~/.ssh/ 中添加需要下載代碼的人的pub_key.

 

 

2、mirror 建立倉庫--使用git倉庫的bare 形式

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

repo sync

會在本地建立很多 .git檔案夾,其中主要包括一個manifest.git。

通過修改maifest.git 可以更快速地搭建倉庫。

 

3、在gerrit服務上修改manifest.git需要走gerrit伺服器註冊流程,如註冊郵箱,添加公開金鑰。

在私人伺服器上修改manifest.git需要走ssh流程,需要將對方公開金鑰加入到本地~/.ssh/authorized_keys

 

4、一個最簡單的倉庫

mkdir test.git

cd test.git

git init --bare 可以產生一個bare倉庫 而git init 可以產生一個worktree倉庫

git clone test.git

cd test

vim .gitignore

touch .gitignore

git add .

git commit -m "add .gitignore"

可以表述一個基本的git倉建立和操作。

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.