Git Config pushInsteadOf is not working

1,077 views
Skip to first unread message

Raf

unread,
Mar 11, 2014, 4:44:33 AM3/11/14
to repo-d...@googlegroups.com
Hi All,

I have been searching high and low for this issue, but somehow I do not see anyone encountering the same issue as me.

Here is the scenario:

I have created a local mirror for my group of developers to download the AOSP code from an external gerrit server.
So the developers will download the code from the mirror but push to the external gerrit server.

Hence, I have edited my /home/user/.gitconfig file to add the following:
#To download from
        [url "ssh://localMirror"]
        insteadOf=ssh://gerritServer
#to push
        [url "ssh://gerritServer"]
        pushInsteadOf = ssh://localMirror


Some how, the pushInsteadOf does not work, when i tried to push the changes to the external gerrit server, it still pushes to the local mirror server.

Also, when I tried to manually add the remote to the repository: git remote add gerrit_origin ssh://gerritServer
I tried to push to the gerrit_origin, it still pushes to the local mirror server. Which is strange..

Please help. I have spent whole day looking for this solution to no avail.

Thanks.

Phil Hord

unread,
Mar 14, 2014, 2:42:01 PM3/14/14
to Raf, Repo and Gerrit Discussion, g...@vger.kernel.org
I thought you had the URLs backwards, but that doesn't seem to be the
problem, assuming I am reading your transcription correctly. Maybe the
'insteadOf' is being applied in addition to (and cancelling out) the
pushInsteadOf. Does it work as expected if you remove one or the
other?

In any case, it sounds like a Git issue, not a Gerrit one. You should
ask on g...@vger.kernel.org, which I have cc'ed here.

Phil

Ian Kumlien

unread,
Mar 17, 2014, 6:03:59 AM3/17/14
to Raf, Repo and Gerrit Discussion
Try this instead:

[url "ssh://gerritServer]
    pushInsteadOf = ssh://gerritServer


--
--
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.

Raf

unread,
Mar 31, 2014, 1:51:18 AM3/31/14
to repo-d...@googlegroups.com, Raf

Hi Phil,

Well, I am trying to download from the local mirror without modifying the manifest file. 

Looks like Ian solved my problem. =)
I just need to do what Ian suggested:

[url "ssh://gerritServer]
    pushInsteadOf = ssh://gerritServer


Thanks a lot all! =)
Reply all
Reply to author
Forward
0 new messages