git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git fetch inside a bare repo does nothing

From
PBPeter Baumann <waste.manager@gmx.de>
Date
Jul 13, 2007, 11:54 UTC
Message-ID
<20070713115426.GA4608@xp.machine.xx>
In-Reply-To
<20070713113209.GA9046@prefect.vdbonline.net>
On Fri, Jul 13, 2007 at 01:32:10PM +0200, CJ van den Berg wrote:
Show 26 quoted lines
> 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
Previous: CJ van den BergNext: Alex Riesen
Message 3 of 5 in “git fetch inside a bare repo does nothing”
  1. Peter BaumannJul 13, 2007
  2. CJ van den BergJul 13, 2007
  3. Peter BaumannJul 13, 2007
  4. Alex RiesenJul 13, 2007
  5. Peter BaumannJul 13, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.