AOSP: Source Code, Repo, Git
<p><strong>Repo</strong> is a Python script developed by Android to facilitate the management of multiple git repositories. The emergence of repo is not to replace git, but to allow Android developers to use git more effectively.</p>
<p>The Android source code contains hundreds of git libraries, and just downloading so many git libraries is a heavy task, so when downloading the source code, Android introduces the repo. The official Android recommended way to download repo is through the Linux curl command. After downloading, add executable permissions to the repo script:</p>
<pre>
$ curl https : // storage . googleapis .com / git - repo - downloads / repo > ~ / bin / repo
$chmod a+x ~ /bin/ repo
</pre>
<p><strong>Note: </strong>The above repo command may change so use another third party channel to get the correct repo libraries.</p>
<h1>How Repo works</h1>
<p>Repo needs to pay attention to the number, name, path, etc. of the current git library. With these basic information, these git libraries can be operated. By centrally maintaining the list of all git libraries, repo can easily obtain the information of git libraries from the list. This list will change as the version evolves and upgrades, and there are also some local modification and customization requirements. Therefore, repo manages the project’s manifest file through a git library. The name of this git library is manifests.</p>
<p>After opening the executable python script repo, I found that the amount of code is not large (no more than 1000 lines). Could it be that this script alone has managed the management of hundreds of git libraries in AOSP? it’s not true. Repo is a collection of scripts, which are also maintained through the git library. The name of the git library is repo.</p>
<p>When the client uses repo to initialize a project, the two git libraries, manifests and repo, will be copied from the remote to the local, but this is almost invisible to Android developers (generally through the file manager, it is impossible to See those two git repositories). Repo hides the automated management information in the .repo subdirectory of the root directory.</p>
<p><a href="https://medium.com/android-knowledge-store/aosp-source-code-repo-git-afd973a00356">Read More</a></p>