weishirongzhen1 / git-repo

Automatically exported from code.google.com/p/git-repo
Apache License 2.0
0 stars 0 forks source link

Enhancement: Allow different urls for push and fetch #191

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Affected Version: 1.21

We are using repo to fetch different repos but without gerrit.
The repositories are fetched via HTTPS in read only mode. Developers with push 
access will push to the repositories via SSH.

So for us it would be nice to be able to specify an additional URL for each 
remote.

Proposal:
Currently a remote is defined like this:
<remote fetch="https://gitserver.local/mirror/" name="mirror" />

With the extension it would be possible to write:
<remote fetch="https://gitserver.local/mirror/" 
push="git@gitserver.local/mirror.git" />

Original issue reported on code.google.com by pasci.bach@gmail.com on 7 Jan 2015 at 9:28

GoogleCodeExporter commented 9 years ago
In case somebody has the same issue. Here is a workaround.

Just add the following to your ~/.gitconfig

[url "git@gitserver.local:"]
        pushInsteadOf = https://gitserver.local/

This way git will rewrite the url for you.

See: http://git-scm.com/docs/git-config and 
https://www.kernel.org/pub/software/scm/git/docs/git-fetch.html

Original comment by pasci.bach@gmail.com on 28 Jan 2015 at 8:50