git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Different Fetch and Push URLs?
@ 2010-02-26 15:01 Tim Visher
  2010-02-26 15:18 ` Tomas Carnecky
  2010-02-26 15:20 ` Jeff King
  0 siblings, 2 replies; 4+ messages in thread
From: Tim Visher @ 2010-02-26 15:01 UTC (permalink / raw)
  To: Git Mailing List

Hello Everyone,

My work situation leaves me in a situation where I can clone from my
central repo but I can't push there.  Is it possible and does it make
any sense to have a single remote with one URL that I pull from and
another than I push to?  I only ask because I was looking at the
output of `git remote show` and noticed that there are 2 URLs.  If it
is possible, how do I do it?  I looked in `.git/config` and there's
only 1 URL there.

I am aware that I could have 2 remotes and simply consciously remember
to only push to the one that I have access to.  This is what I usually
do but the scenario I describe above seems nicer to me.

Thanks!

-- 

In Christ,

Timmy V.

http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Different Fetch and Push URLs?
  2010-02-26 15:01 Different Fetch and Push URLs? Tim Visher
@ 2010-02-26 15:18 ` Tomas Carnecky
  2010-02-26 15:20 ` Jeff King
  1 sibling, 0 replies; 4+ messages in thread
From: Tomas Carnecky @ 2010-02-26 15:18 UTC (permalink / raw)
  To: Tim Visher; +Cc: Git Mailing List

On 2/26/10 4:01 PM, Tim Visher wrote:
> Hello Everyone,
>
> My work situation leaves me in a situation where I can clone from my
> central repo but I can't push there.  Is it possible and does it make
> any sense to have a single remote with one URL that I pull from and
> another than I push to?  I only ask because I was looking at the
> output of `git remote show` and noticed that there are 2 URLs.  If it
> is possible, how do I do it?  I looked in `.git/config` and there's
> only 1 URL there.
>
> I am aware that I could have 2 remotes and simply consciously remember
> to only push to the one that I have access to.  This is what I usually
> do but the scenario I describe above seems nicer to me.

git config remote.origin.pushurl <your push url>

(see the git-config(1) man page for more details)

tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Different Fetch and Push URLs?
  2010-02-26 15:01 Different Fetch and Push URLs? Tim Visher
  2010-02-26 15:18 ` Tomas Carnecky
@ 2010-02-26 15:20 ` Jeff King
  2010-02-26 15:32   ` Tim Visher
  1 sibling, 1 reply; 4+ messages in thread
From: Jeff King @ 2010-02-26 15:20 UTC (permalink / raw)
  To: Tim Visher; +Cc: Git Mailing List

On Fri, Feb 26, 2010 at 10:01:40AM -0500, Tim Visher wrote:

> My work situation leaves me in a situation where I can clone from my
> central repo but I can't push there.  Is it possible and does it make
> any sense to have a single remote with one URL that I pull from and
> another than I push to?  I only ask because I was looking at the
> output of `git remote show` and noticed that there are 2 URLs.  If it
> is possible, how do I do it?  I looked in `.git/config` and there's
> only 1 URL there.

Try "remote.*.pushurl". It's in git-config(1) and in git-push(1) under
"Named remote in configuration file".

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Different Fetch and Push URLs?
  2010-02-26 15:20 ` Jeff King
@ 2010-02-26 15:32   ` Tim Visher
  0 siblings, 0 replies; 4+ messages in thread
From: Tim Visher @ 2010-02-26 15:32 UTC (permalink / raw)
  To: Jeff King; +Cc: Git Mailing List

On Fri, Feb 26, 2010 at 10:20 AM, Jeff King <peff@peff.net> wrote:
> On Fri, Feb 26, 2010 at 10:01:40AM -0500, Tim Visher wrote:
>
>> My work situation leaves me in a situation where I can clone from my
>> central repo but I can't push there.  Is it possible and does it make
>> any sense to have a single remote with one URL that I pull from and
>> another than I push to?  I only ask because I was looking at the
>> output of `git remote show` and noticed that there are 2 URLs.  If it
>> is possible, how do I do it?  I looked in `.git/config` and there's
>> only 1 URL there.
>
> Try "remote.*.pushurl". It's in git-config(1) and in git-push(1) under
> "Named remote in configuration file".

Thanks, both of you.  That worked like a charm.

-- 

In Christ,

Timmy V.

http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-02-26 15:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-26 15:01 Different Fetch and Push URLs? Tim Visher
2010-02-26 15:18 ` Tomas Carnecky
2010-02-26 15:20 ` Jeff King
2010-02-26 15:32   ` Tim Visher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).