Reputation: 303224
Some people in my company use Repo to manage multiple repositories. I need to read (not alter/commit) some of this content.
I'm hoping to avoid installing Repo, and just use Git. Here are the instructions provided for getting the repository I care about:
repo init -u git://git-master/x/manifest.git -b dev/foo-bar -m bar.xml
repo sync
How can I use vanilla Git to synchronize this same information?
Upvotes: 4
Views: 1158
Reputation: 4952
git-repo use a file called manifest.xml
to list all the git repositories of your project.
To get access to the repository using git
only, you just have to get the manifest.xml
, read the repository URL, and clone it.
$ git clone -b dev/foo-bar git://git-master/x/manifest.git
$ vi manifest/bar.xml
You should have something like this (check the manifest format):
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="origin" fetch="git://git-master/x" />
<default revision="master" remote="origin" />
<project name="my/first/project" />
<project name="my/second/project" />
</manifest>
Search the repository you want to clone (e.g my/second/project
), build the clone URL from the manifest.remote.fetch
property. Here we have:
clone URL = git://git-master/x/my/second/project
NOTE: The manifest.remote.fetch
can be an absolute or a relative URL. If it is a relative, you have to add the manifest URL before.
git clone git://git-master/x/my/second/project
NOTE: You can check the manifest.default.revision
and the manifest.project.revision
to be sure that you have fetch the good branch.
Nevertheless, as repo
is just a script you can easily install it in your home directory, like this:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Upvotes: 3