1. 搭建 git 服务器

git服务器有很多,比如使用android 提供的 gerrit 服务器,安装方法参见 gerrit 环境搭建

2 同步远程库

$ mkdir ~/review_site/git/google$ cd ~/review_site/git/google$ repo init -u https://android.googlesource.com/platform/manifest$ head -n 12 .repo/manifest.xml

<?xml version="1.0" encoding="UTF-8"?>

$ repo sync直接同步(sync)会出现”代码库不存在“错误,是因为使用的repo不支持manifest相对路径。 如果从 http://android.git.kernel.org/repo 下载 repo 就会有这个问题,建议从 https://chromium.googlesource.com/external/repo 下载 需要参照上面修改 .repo/manifest.xml 文件中的 fetch 节点,然后再同步。

3 调整代码库

如果需要对 android 进行二次开发,最好创建自己的分支,方法如下:

3.1 所有项目增加分支

直接在代码库中执行
$ repo forall -c git branch --no-track mybranch master

3.2 manifest 项目增加相应分支

  • 首先,在本地同步 manifest 库
$ cd ~$ git clone ~/review/git/platform/manifest.git
  • 其次,增加新分支,并对 default.xml 作相应调整
$ cd ~/manifest$ git checkout -b mybranch origin/master$ head -12 defalut.xml<?xml version="1.0" encoding="UTF-8"?>            
  • 推送到代码库中

$ git add defalut.xml$ git commit -m "modify manifest"$ git push origin mybranch:mybranch

更多相关文章

  1. Android(安卓)Junit 单元测试步骤
  2. android webview 设置
  3. android 设置bitmap 设置图片的大小
  4. Android(安卓)文件存储--内部存储的例子
  5. Error:Uncaught translation error: com.android.dx.cf.code.Sim
  6. Android漂亮的Help提示框
  7. android中和c++中生产者和消费者模式
  8. Android中的Category
  9. android 随手记 SQLITE代码 直接能用

随机推荐

  1. Android设计登录界面、找回密码、注册功
  2. Android Lint
  3. 介绍两个Android开源项目:Android显示GIF
  4. android图形叠加背景的写法
  5. Android仿微信文章悬浮窗效果
  6. android 正三角,倒三角的实现代码
  7. android ui RelativeLayout中按扭平行显
  8. android 开发中常用尺寸
  9. android开发者网站
  10. Android (Go edition)