3

I want to specify two different fetch servers for single git repo in android repo manifest .xml. Is it possible to do?

Actually I am having one local mirrored repo and want to sync my new repo from this. But as some of the git repositories are not in the local mirror I want to fetch all these git from remote.

parsley72
  • 8,449
  • 8
  • 65
  • 98
  • Are you referring to using [Google git-repo](https://code.google.com/p/git-repo/)? It's unclear. –  Jul 25 '13 at 12:14
  • Yes. I am talking about google git-repo. – Maulik Patel Jul 29 '13 at 11:19
  • Yes. I am talking about google git-repo. I have created local mirrored repository for Android-JB code. Now I want to clone Android-ICS code but I don't want to sync the duplicated code from local Android-JB repo and all other code I want to sync from remote repository. What I have done is initialized the repo with the Android-ICS remote url. then edited the remote tag(in .repo/manifest.xml) to fetch from local repo. But now what problem I am facing is whenever any package is not there in local repo then repo sync hangs up and exiting with error. – Maulik Patel Jul 29 '13 at 11:26
  • What I want is I want to provide two remote location for all the repos into .repo/manifest.xml. So that first it will try to sync from local repo, if package is found in local repo then sync from local repo, otherwise it should fetch from remote location(Instead of hanging up with error git repository not found). So is it possible to provide two fetch location for single git repository in manifest.xlm file of repo? This is my exact question. I think now it should be clear to you? – Maulik Patel Jul 29 '13 at 11:30

1 Answers1

-1

You can do it by adding new remote and then fetch from the 2 remotes.

http://git-scm.com/book/en/Git-Basics-Working-with-Remotes#Adding-Remote-Repositories

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
  • 1
    But how can I do that in repo? I checked this link and knows about "git remote" commands. But I want to set my repo in such a way that while I do "repo sync" it will search in local repo first, if any git is not found in local repo then it will automatically fetch the same from remote server. Is it possible in repo? I know you can specify different fetch location using "remote=" tags but I want to set two remotes for single git. – Maulik Patel Jul 25 '13 at 11:24
  • I downvoted because the question is asking how to do this with a specific tool (google's tool called "repo") and this answer does not attempt to answer it. – user253751 Jul 15 '19 at 23:46