Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using the android repo tool for a personal project

Tags:

git

repository

Has anyone used Repo as a tool to manage multiple git repos in a personal project? It seems like Google created the tool so it could be used by other people, but I can't find any information on how to do so. If anyone knows how to do this or of some sort of walkthrough available, it would be much appreciated.

like image 575
creynia Avatar asked Aug 12 '11 21:08

creynia


People also ask

What is Android repo?

Repo uses manifest files to aggregate Git projects into the Android superproject. You can put the repo command, which is an executable Python script, anywhere in your path. In working with the Android source files, you can use Repo for across-network operations such as with a single Repo working directory.

How repo tool works?

The Repo Launcher provides a Python script that initializes a checkout and downloads the second part, the full Repo tool. The full Repo tool is included in an Android source code checkout. It's located, by default, in $SRCDIR/. repo/repo/... and it receives forwarded commands from the downloaded Repo Launcher.


1 Answers

Here's how to use repo for your own project.

On the remote git server, create a folder and call it manifest or something similar, go into that directory and type git init. In the same directory as where this folder is located, you should have your other Git repositories. So for example, the folders manifest, repo1, and repo2 are all in the same directory, and they are all Git repositories.

Now you have to configure the manifest. Go into the manifest folder and create a file called default.xml. Here's how it would look for this setup.

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <remote name="origin"
          fetch="." />

  <default remote="origin"
           revision="master" />

  <project path="repo1" name="repo1" />
  <project path="repo2" name="repo2" />
</manifest>

Commit the file, and your remote repository is all setup.

Now locally, create a directory called my-repo. Inside my-repo, type the command

repo init -u [email protected]:/path/to/manifest/directory/

This clones the manifest repository. Now if you type repo sync, repo will uses the data from the manifest to clone all of the other repositories it points to.

For more information on the manifest file, go into my-repo and type repo help manifest

like image 122
gsingh2011 Avatar answered Sep 24 '22 13:09

gsingh2011