manifest.git manifest.xml file and multiple <remote fetch=<url> name=<unique name> entries

2,616 views
Skip to first unread message

markk...@gmail.com

unread,
Oct 30, 2017, 11:33:44 AM10/30/17
to Repo and Gerrit Discussion
I am looking for some possible explanations why if i have multiple <remote fetch=<url> name=<unique name> />
that I do not see all remotes listed in the <project ... ./> .git/config files?

I appear to only be seeing the default related remote in the .git/config file.

reading the git-repo/master/docs/manifest-format.txt file the Element remote does say you can have one or more remote elements specified.
And the name specified in the Attribute `name` is used as the remote name in each project's .git/config.

Thank you,
Mark K 

markk...@gmail.com

unread,
Oct 30, 2017, 2:07:48 PM10/30/17
to Repo and Gerrit Discussion
Maybe a clarification is needed here.  I was under assumption that if you had multiple remote's listed you would see each remote entry
in the .git/config file. That does not appear will happen.

If the intention is for the additional remote entry is that you would have a least one git project to
use that remote as the source to get that git project then I am incorrectly assuming how the remote entries work.

I was thinking I could alter the manifest.xml file so that multiple remotes could be referenced in a project to make it easier to run commands like git log or git diff/etc.

Mark K

David Pursehouse

unread,
Oct 30, 2017, 11:17:28 PM10/30/17
to markk...@gmail.com, Repo and Gerrit Discussion
The purpose of the "remote" element is not to add multiple remotes in the config of the cloned projects, but to allow to define a manifest in which some projects are cloned/fetched from different servers.

For example if you define a manifest like this:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <remote fetch="https://gerrit.googlesource.com/" name="gerrit" />
  <remote fetch="https://github.com/GerritCodeReview/" name="github" />
  <default remote="gerrit" revision="master" />

  <project name="gerrit" />
  <project name="gitiles" remote="github" />
</manifest>

then it will clone/fetch the "gerrit" project from the default remote ("gerrit"), and the "gitiles" project from the "github" remote.  In the workspace, each project's remote config will have the remote from which it was cloned/fetched:

gerrit $ git remote -v
gerrit $ cd ../gitiles/
gitiles $ git remote -v

If you want to add another remote to the projects, you can do that after repo sync with something like:

repo forall -c 'git remote add myremote https://path/to/remote/$REPO_PROJECT'


--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages