克隆的Andr​​oid源到本地存储库服务器 [英] Cloning Android sources to a local repository server

查看:115
本文介绍了克隆的Andr​​oid源到本地存储库服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开发在Android上面使用本地的Andr​​oid库服务器。我需要一些新的Git存储库添加到控释片的层次,我需要修改现有的Andr​​oid源为Android的定制剪裁。

I want to develop on top of Android using a local Android repository server. I need to add several new git repositories to the hierarchy of gits, and I need to modify existing android sources for a custom tailoring of Android.

什么是正确的方式来克隆Git存储库的整个Android的源代码树,这样我可以从Android的推/拉/从一个共同的本地资源库服务器,仍然很容易拉动的新变化上游?

我专门寻找建议如何使用回购脚本的互动与我自己的服务器,以及如何建立清单 Git仓库,并在其中管理分支机构。

I am specifically looking for advice on how to use the repo script for interaction with my own server, and how to set up the manifest git repository and managing branches therein.

推荐答案

在您的git的服务器

  1. 在回购的init -u <一href="https://android.googlesource.com/platform/manifest">https://android.googlesource.com/platform/manifest --mirror #--mirror是关键
  2. 回购同步
  1. repo init -u https://android.googlesource.com/platform/manifest --mirror # --mirror is the key
  2. repo sync

由于您指定--mirror,创造将是'裸'回购,这是混帐正确的方式来创建一个镜像,除非你是个混蛋uberlord全部回购。

Because you specified --mirror, all repos created will be 'bare' repos, which is the git-correct way to create a mirror unless you are a git uberlord.

在您的客户端:

  1. 回购的init -u git@git.yourserver.com:平台/ manifest.git#的您可以使用访问您的Git服务器的不同手段;我要承担的东西的这个例子。

没有回购同步呢。的你的表现很可能是错误的。看看符号链接的.repo / manifest.xml的......猫并阅读顶部的&LT;远程读取= ...它可能指回android.googlesource.com。但如果说'..'我的认为的,这意味着回来我的服务器,这样你就可以跳到第6步)。但是,如果它确实点背到另一台服务器(不是你的),然后转至步骤3。

no repo sync yet. Your manifest is probably wrong. Look at the symbolic linked .repo/manifest.xml... cat it and read at the top the <remote fetch=""... it probably points back to android.googlesource.com. but if it says '..' I think that means 'come back to my server', so you can skip to step 6). But if it does point back to another server (not yours), then go to step 3.

当你看到一个'无明显修改回购初始化;回购同步工作,然后去你default.xml中又和刚开始添加连同其他现有的Andr​​oid项目元素万吨新的XML元素;这些新元素将指向您的自定义项目。对于这些新的项目,只是git的初始化他们像往常一样,并确保它们具有相匹配的同样的一个分支&LT;默认的修订版=whatever_branch_you_see_here,使得回购同步会遇到这些新项目时取得成功。

Once you see a 'no manifest edit' repo init; repo sync work, then go to your default.xml again, and just start adding new XML elements along with the tons of other existing Android project elements; these new elements will point to your custom projects. For these new projects, just git init them as you normally would, and make sure they have a branch matching the same <default revision="whatever_branch_you_see_here" so that a repo sync will succeed when it encounters these new projects.

如果你确实设置默认分支您的清单&LT;默认版本=元素,然后只是让每个人都做一个本地分支设置遵循远程分支在修订属性指定。因此,举例来说,如果&LT;默认的修订版=branch_a是在你的清单,你做一个回购同步后,当你cd到感兴趣的子项目,做了:

If you do indeed set a default branch in your manifest <default revision="" element, then just have everyone make a local branch set to follow the remote branch specified in the revision attribute. So, for example, if <default revision="branch_a" is in your manifest, after you do a repo sync, when you cd into a sub-project of interest, do a :

git的结帐-b branch_a产地/ branch_a

之后,如果用户混帐推的(没有回购命令推,据我所知),如果别人做了 ./回购同步的推后,他们会因为你使用的是相同的清单和实际推到默认版本(分公司获得原始的用户这些变化......只要)指定的清单。

Then, if the user git push's (there is no repo command to push, as far as I'm aware), and if someone else does a ./repo sync after that push, they will get those changes from the original user... as long as you are using the same manifest and actually pushing to the default revision (branch) specified by that manifest.

这是最简单的食谱。如果你想实际功能的分支,那么你就必须编辑您的清单,如果你想'回购同步只是工作...更经常的的你必须传达给其他地区球队抓住你的清单版本,当你做到这一点。或者,如果它只是一个或两个混帐回购你触摸,那么你可以只放弃回购同步和git推/拉正常人一样对这些回购协议,而忽略了安静的树的时候,你都严重迭代休息。这听起来,最终对我来说,就像一个简单的路径。我忽略了回购尽可能多的,你可能可以;只使用它的所有项目同步,独自离开它,你的重点是1或2个项目的时间。

That's the simplest recipe. If you want to make actual feature branches, then you'll have to edit your manifest more regularly if you want 'repo sync' to just work... and you will have to communicate to the rest of the team to grab your version of the manifest when you do that. Alternatively, if it's just one or two git repos you are touching, then you could just forego repo sync and git push/pull like normal on those repos and ignore the rest of the quiet tree for the times you are heavily iterating. This sounds, ultimately to me, like a simpler path. I'd ignore repo as much as you possibly can; only using it for 'all project' syncs and leaving it alone for the times you are focusing on 1 or 2 projects.

对于从上游得到更新。我想做到这一点的方法是改变你的default.xml中指向回你原来的git的位置(如android.googlesource.com),做一个回购同步,使所有新的东西合并的,而一旦与完成同步,保证备份到您的回购。我没有这样做还;所以我不能太具体,但是这是我计划如何做到这一点。

Regarding getting updates from upstream. I think the way to do that is to change your default.xml to point back to your original git location (like android.googlesource.com), do a repo sync to cause all the new stuff to merge in, and once done with the sync, commit back up to your repo. I haven't done this yet; so I can't be too specific, but this is how I plan to do it.

我忽略了上面的服务器管理的详细信息。举例来说,你需要调用你的Git服务器上的某个目录回购初始化引起它是一个可用的git仓库;我假设你知道如何管理您的Git服务器。

I'm ignoring server administration details above. For instance, you need to call the repo init in a certain directory on your git server to cause it to be an available git repository; I'm assuming you know how to administer your git server.

这篇关于克隆的Andr​​oid源到本地存储库服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆