Using the android repo tool for a personal project
Has anyone used Repo as a tool to manage multiple git repos in a personal project? It seems like Google created the tool so i开发者_如何学JAVAt 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.
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 username@myserver.com:/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
精彩评论