什么是 Repo 以及 Google 为什么使用它?

发布于 2024-08-25 09:51:01 字数 135 浏览 5 评论 0原文

当我想获取Android源代码时,我知道我必须使用“repo”。那么什么是回购协议呢?为什么他们使用 repo 而不仅仅是使用 GIT?并且是否有一个用于 repo 的 GUI 使我能够暂停/恢复同步,因为每次我偶尔断开连接时,repo 似乎从头开始同步!

When I wanted to get Android source code, I knew that I have to use "repo". So what is repo? Why do they use repo and not just use GIT?, and is there a GUI for repo that enables me to pause/resume syncing, because every time I get disconnected occasionally it seems that repo starts syncing from the beginning!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

天生の放荡 2024-09-01 09:51:01

正如 android 网页中提到的,repo 不会取代 git。它只是 git 上的一个工具,可以帮助您管理多个 git 存储库。

例如,假设我有一个具有很多功能的大项目,并且我有多个团队致力于每个功能,并且我为每个功能创建了一个存储库。例如,假设我的存储库是 wifitelephonypower management 等。当您的功能具有不同的生命周期时,此操作有意义。例如,如果我不会在下一个版本中触及 wifi 功能,但我会修改其余所有功能。所以在这种场景下,我的项目或者产品分布在几个不同的git仓库中。

因此,为了获得我的项目的集中照片(我的项目的一个特定时刻,例如里程碑),我需要获取每个存储库的修订(git 哈希或标签)。请记住,我们为每个功能都有一个存储库。我可以手动完成,但可能会非常痛苦。因此,通过 repo,您​​可以拥有一个 MANIFEST,它链接到每个 git repo 的所有修订版(每个功能一个),并拥有我的整个项目的具体图片。

简而言之,我可以说这是一种管理集中式多个分散的 git 存储库的方法。

使用 repo,您​​可以拥有更多功能,而不仅仅是在特定点结账。有关更多信息,请访问 http://source.android.com/source/using-repo .html

As is mentioned in the android webpage, repo does not replace git. It is just a tool over git and helps you to manage multiple git repositories.

For example, suppose I have a big project which has a lot of features and I have several teams working on each feature and I created one repository for each feature. For example suppose my repositories are wifi, telephony, power management, etc. This action has sense when your features have different life cycles. For example if I won't touch the wifi feature in my next release and but I will modify all the rest. So under this scenario, my project or product is distributed in several different git repositories.

So, to get a centralized photo of my project (one specific moment of my project, for example a milestone), I need to get the revision (git hash or tag) of each repository. Remember that we have one repository for each feature. Manually I could do it but could be very painful. So, with repo you can have one MANIFEST which links to all the revisions of each git repo (one for each feature) and have a specific picture of my whole project.

Simply, I could say that is a way to manage centralized multiple git repositories which are decentralized.

With repo you have more features, not only to checkout at a specific point. For more info go to http://source.android.com/source/using-repo.html.

久光 2024-09-01 09:51:01

Repo 和 git - 它们是什么,它们的用途 - 在 source.android.com 上进行了解释

要使用 Android 代码,您
需要同时使用 Git 和 Repo。

Git 是一个开源版本控制系统,旨在
处理非常大的项目
分布在多个
存储库。在这样的背景下
Android,我们本地使用Git
本地分支等操作,
提交、差异和编辑。

Repo 是我们在 Git 之上构建的工具。 Repo 帮助我们管理
许多 Git 存储库,
上传到我们的修订控制
系统,并自动化部分
Android 开发工作流程。回购协议是
并不是为了取代 Git,只是为了让
使用 Git 更容易
Android 的上下文。回购命令
是一个可执行的Python脚本
您可以将其放置在路径中的任何位置。

据我所知,Repo 没有 GUI,但上面的网站上有很多指导,用于控制 Repo 从命令行执行的操作。

Repo and git - what they are, what they are for - is explained on source.android.com

To work with the Android code, you
will need to use both Git and Repo.

Git is an open-source version-control system designed to
handle very large projects that are
distributed over multiple
repositories. In the context of
Android, we use Git for local
operations such as local branching,
commits, diffs, and edits.

Repo is a tool that we built on top of Git. Repo helps us manage the
many Git repositories, does the
uploads to our revision control
system, and automates parts of the
Android development workflow. Repo is
not meant to replace Git, only to make
it easier to work with Git in the
context of Android. The repo command
is an executable Python script that
you can put anywhere in your path.

There's no GUI for Repo, as far as I can tell, but there's quite a bit of guidance on the site above for controlling what Repo is doing from the command line.

一身仙ぐ女味 2024-09-01 09:51:01

关于暂停和重新启动点,在终端窗口中进行存储库同步时,您可以点击“ctrl + z”来暂停存储库同步。要重新启动,只需在同一窗口中输入“fg”即可。

Concerning the pause and restart point, whilst in a terminal window doing a repo sync you can hit, "ctrl + z" to pause the repo sync. To restart simply type "fg" into the same window.

情话已封尘 2024-09-01 09:51:01

转到:

http://source.android.com/source/git-repo.html

,您可以下载repo脚本。它是一个 Python 脚本,使用 git 命令进行分布式源代码修订。

执行reposync后,执行ps -auwf来查看进程:

对于我的我看到:

\_ python -E /sde3/root/download/android/android/.repo/repo/main.py --rep 
      \_ git fetch korg
            \_ git fetch korg
            \_ git index-pack --stdin -v --fix-thin --keep=fetch-pack 5227 on

是的,repo 同步经常中断。但它很强大,只需重新启动命令,它就会再次恢复同步 - 那些已更新的内容将不会重新应用,因此它将跳过它们并继续其余部分。

Go to:

http://source.android.com/source/git-repo.html

and you can download the repo script. It is a Python script that uses the git command to do distributed source code revision.

After you have executed repo sync, do a ps -auwf to see the processes:

For mine I saw:

\_ python -E /sde3/root/download/android/android/.repo/repo/main.py --rep 
      \_ git fetch korg
            \_ git fetch korg
            \_ git index-pack --stdin -v --fix-thin --keep=fetch-pack 5227 on

Yes, repo sync breaks often. But it is robust, just restart the command and it will resuming syncing again - those that have been updated will not be re-applied, so it will skip over them and continue with the rest.

在你怀里撒娇 2024-09-01 09:51:01

repo 同步有各种有用的选项:

-f 从断开连接中恢复

-c 仅上传您要求的分支

-j <#CPUS>通过增加命令使用的 cpu 数量来加速同步

repo sync has various useful options:

-f recovers from disconnects

-c just uploads the branch you asked for

-j <#CPUS> speeds up the sync by increasing the number of cpus used by the command

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文