git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git fetch inside a bare repo does nothing
@ 2007-07-13 10:33 Peter Baumann
  2007-07-13 11:32 ` CJ van den Berg
  2007-07-13 12:48 ` Alex Riesen
  0 siblings, 2 replies; 5+ messages in thread
From: Peter Baumann @ 2007-07-13 10:33 UTC (permalink / raw)
  To: git

kblin on IRC wanted to know how to update a bare repo with fetching.
He wants to have a bare repo of samba as a mirror and clone from this
mirror to avoid network traffic and to have several git repos which
could all have a different branch checked out. For a better description
see [1].

I suggested to use "git fetch --bare" inside the bare repo, but this
doesn't work. So what I'm asking now if this is intenional behaviour or
a bug, so please could someone  shed some light on it?  Or how is the
prefered method to update a bare repo *without* pushing to it?

-Peter

[1]: http://wiki.samba.org/index.php/Using_Git_for_Samba_Development

IRC log (unneccessary comments removed):

11:30 < kblin> how do I update a branch I cloned with --bare?
11:31 < madduck> GIT_DIR=/path/to/dir git pull >
11:31 < madduck> ?
11:31 < madduck> without the >
11:32 < kblin> and for remote repositories, I'd use a URL?
11:37 < madduck> uh, you can't reallly "update" remote repositories in that sense
11:37 < madduck> what are you trying to do?
11:37 < madduck> let's have more info!
11:51 < kblin> madduck: I'm trying to follow http://wiki.samba.org/index.php/Using_Git_for_Samba_Development
11:52 < kblin> madduck: basically, I want to have a --bare repository that mirrors the remote repository
               and have a couple of working repositories for the different branches
11:57 < siprbaum> kblin: I think "git --bare fetch" inside your bare repo will solve your problem
[...]
12:01 < kblin> siprbaum: git --bare fetch doesn't seem to fetch anything new either
12:01 < siprbaum> perhaps there isn't anything new to fetch?
12:02 < siprbaum> but i'm just guessing here and reading the manpage (git) suggested that git --bare fetch _could_ work
12:02 < kblin> siprbaum: that'd surpise me. I've got a clone without the --bare, and that has a new commit
[...]
12:14 < siprbaum> kblin: and you are right. i just tried to fetch inside a bare repo and it doesn't work

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

* Re: git fetch inside a bare repo does nothing
  2007-07-13 10:33 git fetch inside a bare repo does nothing Peter Baumann
@ 2007-07-13 11:32 ` CJ van den Berg
  2007-07-13 11:54   ` Peter Baumann
  2007-07-13 12:48 ` Alex Riesen
  1 sibling, 1 reply; 5+ messages in thread
From: CJ van den Berg @ 2007-07-13 11:32 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1289 bytes --]

On Fri, Jul 13, 2007 at 12:33:03PM +0200, Peter Baumann wrote:
> kblin on IRC wanted to know how to update a bare repo with fetching.
> He wants to have a bare repo of samba as a mirror and clone from this
> mirror to avoid network traffic and to have several git repos which
> could all have a different branch checked out. For a better description
> see [1].
> 
> I suggested to use "git fetch --bare" inside the bare repo, but this
> doesn't work. So what I'm asking now if this is intenional behaviour or
> a bug, so please could someone  shed some light on it?  Or how is the
> prefered method to update a bare repo *without* pushing to it?

"git fetch" works fine in a bare repo. The issue you're probably having is
that "git clone --bare" does not add a [remote "origin"] section to the
config file like regular "git clone" does, so "git fetch" has nothing to
do. Just add a remote section (either with "git remote add" or manually) and
regular "git fetch" will work fine.

Just for reference, this is the remote section that is equivalent to the
original "git clone --bare your_uri_here":

[remote "origin"]
        url = your_uri_here
        fetch = +refs/heads/*:refs/heads/*


-- 
CJ van den Berg

mailto:cj@vdbonline.com
  xmpp:cj@vdbonline.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: git fetch inside a bare repo does nothing
  2007-07-13 11:32 ` CJ van den Berg
@ 2007-07-13 11:54   ` Peter Baumann
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Baumann @ 2007-07-13 11:54 UTC (permalink / raw)
  To: CJ van den Berg; +Cc: git

On Fri, Jul 13, 2007 at 01:32:10PM +0200, CJ van den Berg wrote:
> On Fri, Jul 13, 2007 at 12:33:03PM +0200, Peter Baumann wrote:
> > kblin on IRC wanted to know how to update a bare repo with fetching.
> > He wants to have a bare repo of samba as a mirror and clone from this
> > mirror to avoid network traffic and to have several git repos which
> > could all have a different branch checked out. For a better description
> > see [1].
> > 
> > I suggested to use "git fetch --bare" inside the bare repo, but this
> > doesn't work. So what I'm asking now if this is intenional behaviour or
> > a bug, so please could someone  shed some light on it?  Or how is the
> > prefered method to update a bare repo *without* pushing to it?
> 
> "git fetch" works fine in a bare repo. The issue you're probably having is
> that "git clone --bare" does not add a [remote "origin"] section to the
> config file like regular "git clone" does, so "git fetch" has nothing to
> do. Just add a remote section (either with "git remote add" or manually) and
> regular "git fetch" will work fine.
> 
> Just for reference, this is the remote section that is equivalent to the
> original "git clone --bare your_uri_here":
> 
> [remote "origin"]
>         url = your_uri_here
>         fetch = +refs/heads/*:refs/heads/*
> 
> 
Thx. This wasn't exactly my problem but it lead me to the real problem:
I used
	git fetch /path/to/repo master

and had forgotten that I had to specify the local ref, too.

	git fetch /path/to/repo master:master

worked as expected. Sorry for the noise.

-Peter

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

* Re: git fetch inside a bare repo does nothing
  2007-07-13 10:33 git fetch inside a bare repo does nothing Peter Baumann
  2007-07-13 11:32 ` CJ van den Berg
@ 2007-07-13 12:48 ` Alex Riesen
  2007-07-13 17:16   ` Peter Baumann
  1 sibling, 1 reply; 5+ messages in thread
From: Alex Riesen @ 2007-07-13 12:48 UTC (permalink / raw)
  To: git

On 7/13/07, Peter Baumann <waste.manager@gmx.de> wrote:
> I suggested to use "git fetch --bare" inside the bare repo, but this

"git --bare fetch".

You swapped "fetch" and "--bare".

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

* Re: git fetch inside a bare repo does nothing
  2007-07-13 12:48 ` Alex Riesen
@ 2007-07-13 17:16   ` Peter Baumann
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Baumann @ 2007-07-13 17:16 UTC (permalink / raw)
  To: Alex Riesen; +Cc: git

On Fri, Jul 13, 2007 at 02:48:19PM +0200, Alex Riesen wrote:
> On 7/13/07, Peter Baumann <waste.manager@gmx.de> wrote:
>> I suggested to use "git fetch --bare" inside the bare repo, but this
>
> "git --bare fetch".
>
> You swapped "fetch" and "--bare".

Sorry, this was only a typo in the mail.
But the problem got fixed, anyway.

-Peter

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

end of thread, other threads:[~2007-07-13 17:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-13 10:33 git fetch inside a bare repo does nothing Peter Baumann
2007-07-13 11:32 ` CJ van den Berg
2007-07-13 11:54   ` Peter Baumann
2007-07-13 12:48 ` Alex Riesen
2007-07-13 17:16   ` Peter Baumann

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