Using insteadof to access local mirror

876 views
Skip to first unread message

Igor

unread,
Jun 29, 2011, 10:23:30 AM6/29/11
to Repo and Gerrit Discussion
Hi group,

I'm trying to setup a local mirror of a remote repo, which is located
in another site of our company.
I created a mirror with 'repo init -u ssh://serv01/git/android/platform/manifest.git
-b branch --mirror' on a
network location: /nfs/storage/localrepo.

The manifest contains several remotes, smth like:

<remote fetch="git://android.git.kernel.org/" name="korg"
review="review.source.android.com"/>
<remote fetch="ssh://serv01/git/android/" name="shgit"
review="http://serv01/r/"/>
<remote fetch="ssh://serv01/git/pie/" name="piegit" review="http://
serv01/r/"/>
<remote fetch="ssh://serv01/git/pt/" name="ptgit" review="http://
serv01/r/"/>

Then I init from localrepo from another account:

repo init -u /nfs/storage/localrepo/platform/manifest.git -b branch

In order to fetch data from localrepo instead of remote server I setup
the following git config values:

git config --global url.ssh://serv01/git/android/.insteadOf /nfs/
storage/localrepo/
git config --global url.ssh://serv01/git/pie/.insteadOf /nfs/storage/
localrepo/
git config --global url.ssh://serv01/git/pt/.insteadOf /nfs/storage/
localrepo/

After this I expect repo sync to fetch only from /nfs/storage/
localrepo/, but it prompts for serv01 password.

Did I miss smth? How can I make repo sync connect only to localrepo?

Any help will be apprecated.

Thanks,
Igor.

Magnus Bäck

unread,
Jun 29, 2011, 1:28:13 PM6/29/11
to Repo and Gerrit Discussion
On Wednesday, June 29, 2011 at 16:23 CEST,
Igor <igor.lit...@gmail.com> wrote:

So, you're ~/.gitconfig looks like this?

[url "ssh://serv01/git/android/"]
insteadOf = /nfs/storage/localrepo

This means "replace all occurences of /nfs/storage/localrepo with
ssh://serv01/git/android/", which sounds like the exact opposite
of what you want. You probably want to run this command instead:

git config --global url./nfs/storage/localrepo/.insteadOf \
ssh://serv01/git/android/

--
Magnus Bäck Opinions are my own and do not necessarily
SW Configuration Manager represent the ones of my employer, etc.
Sony Ericsson

Igor

unread,
Jun 30, 2011, 2:44:27 AM6/30/11
to Repo and Gerrit Discussion
Thanks Magnus,

I was sure it must have been smth stupid like this ...

Igor.
Reply all
Reply to author
Forward
0 new messages