是什么/​​裸Git代码库中的.repo /项目通过了Android回购脚本创建的目的是什么? [英] What are the purpose of the bare git repositories in .repo/projects/ created by the Android repo script?

查看:169
本文介绍了是什么/​​裸Git代码库中的.repo /项目通过了Android回购脚本创建的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

借助 Android源通过的回购。当使用回购同步,目录名为的.repo /项目/ 创建,它包含了所有的Git代码库也在当前工作目录签出直接,只是光秃秃的git格式

The Android source is managed by repo. When syncing using repo, a directory called .repo/projects/ is created, which contains all the git repositories also checked out directly in the current working directory, just in bare git format.

为了什么目的,不回购维持裸git仓库?以及如何使用这些回购裸露的库?

(注:澄清:我不是在谈论一个Git仓库当我写回购,我说特别是关于所谓的 回购 通过/维护所有的Git仓库包含了Android的源创建为Android。)

推荐答案

在与Android的回购舱单系统一段时间后,我觉得我现在明白裸存储库中的的.repo的目的/项目/ 目录。

After working with the Android repo manifest system for a while, I think I now understand the purpose of the bare repositories in the .repo/projects/ directory.

前面已经回答了@Fredrik项目有没有仓库的另一个副本再直接通过回购创建的克隆psented $ P $。事实上,在克隆的所有 git的目录的内容都只是符号链接,这样的:

As already answered by @Fredrik the projects there are not another copy of the repositories represented directly in the "clone" created by repo. In fact the content of all the .git directories in the clone are just symlinks, like this:

$ ll development/.git/
total 452
drwxr-xr-x  2 bfh bfh   4096 2011-08-15 13:55 ./
drwxr-xr-x 20 bfh bfh   4096 2011-08-15 13:55 ../
lrwxrwxrwx  1 bfh bfh     43 2011-08-15 13:55 config -> ../../.repo/projects/development.git/config
lrwxrwxrwx  1 bfh bfh     48 2011-08-15 13:55 description -> ../../.repo/projects/development.git/description
-rw-r--r--  1 bfh bfh     41 2011-08-15 13:55 HEAD
lrwxrwxrwx  1 bfh bfh     42 2011-08-15 13:55 hooks -> ../../.repo/projects/development.git/hooks/
-rw-r--r--  1 bfh bfh 449008 2011-08-15 13:55 index
lrwxrwxrwx  1 bfh bfh     41 2011-08-15 13:55 info -> ../../.repo/projects/development.git/info/
lrwxrwxrwx  1 bfh bfh     41 2011-08-15 13:55 logs -> ../../.repo/projects/development.git/logs/
lrwxrwxrwx  1 bfh bfh     44 2011-08-15 13:55 objects -> ../../.repo/projects/development.git/objects/
lrwxrwxrwx  1 bfh bfh     48 2011-08-15 13:55 packed-refs -> ../../.repo/projects/development.git/packed-refs
lrwxrwxrwx  1 bfh bfh     41 2011-08-15 13:55 refs -> ../../.repo/projects/development.git/refs/
lrwxrwxrwx  1 bfh bfh     45 2011-08-15 13:55 rr-cache -> ../../.repo/projects/development.git/rr-cache/
lrwxrwxrwx  1 bfh bfh     40 2011-08-15 13:55 svn -> ../../.repo/projects/development.git/svn

因此​​实际的Git仓库只重新在克隆psented一次$ P $。

Thus the actual git repositories are only represented once in a clone.

之所以保持一个光秃秃的一个普通的Git是因为舱单系统的工作方式即可。清单系统是指定将被检出,并在其中版本它们将被检出GITS的集合的一种方式。清单文件本身保持在一个混帐,而回购命令可以改变这种明显的Git分支,都可以。

The reason for keeping a bare and a normal git are then because of the way the manifest system works. The manifest system is a way of specifying a collection of gits that will be checked out, and in which version they will be checked out. The manifest file is itself maintained in a git, and the repo command allows changing the branch of that manifest git as you please.

因此​​,允许删除和添加控释片取决于是什么在清单文件当前拾取的(快)的方式,回购可以只保留你曾经克隆在的控释片的.repo /项目文件夹,然后只将它们复制到,如果他们选择在清单文件的当前分支正常克隆区域。

Thus to allow a (fast) way of removing and adding gits depending on what is currently picked in the manifest file, repo can just keep all the gits you have ever cloned in the .repo/projects folder, and then only copy them to the "normal" clone area if they are chosen in the current branch of the manifest file.

这篇关于是什么/​​裸Git代码库中的.repo /项目通过了Android回购脚本创建的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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