How does the repo of android source code work ?
.repo
通常情况下, Android 的 .repo 里面有如下内容:
1 | $ ls .repo |
manifests
manifests 路径是项目 manifest 仓的 git checkout,其中的 .git 是 manifest.git 的软链接,追踪 repo init --manifest-branch 指定的分支。
1 | .repo$ ls manifests/.git/ |
不管远程分支名字是什么,manifests 的本地分支命名为 default。
1 | .repo$ cat manifests/.git/HEAD |
manifests.git
manifests.git 是当前项目 manifest 仓的一个没有工作空间的 checkout,即只 checkout .git ,追踪repo init --manifest-url 指定的 Git 仓。不能手动修改这部分,如果需要修改的话,可重新运行 repo init 来更新设置。
.repo_config.json
缓存 manifests.git/config,用来提升 repo 的速度。
manifest.xml
repo 使用的 manifest , 此文件由 repo init --manifest-name 指定链接到 manifests 中的哪一个文件,如下:
1 | manifest.xml -> manifests/<manifest-name>.xml # 指向用户希望用来同步源码的 manifest |
