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

Re: Git Fetch / updating HEAD

From
Johan Herland <johan@herland.net>
Date
Jul 17, 2010, 16:11 UTC
Message-ID
<201007171811.13624.johan@herland.net>
In-Reply-To
<AANLkTilp5lZn99QZPWSkCHStnRdkGx6mMU2IQBvllaU4@mail.gmail.com>
On Saturday 17 July 2010, Mahesh Vaidya wrote:
> BTW - I have tried this
> git  update-ref HEAD  FETCH_HEAD; is this ok ??
> 
> On Sat, Jul 17, 2010 at 9:02 PM, Mahesh Vaidya <forvaidya@gmail.com> 
wrote:
Show 10 quoted lines
> > Hi,
> > 
> > git fetch --all --append updates FETCH_HEAD. I'd like this command to
> > update HEAD as well; is there any flag ?
> > 
> > I have a reason to do it; trying to implement multisite
> > 
> > A (master) -> B (readonly mirror) -> C (workspace)
> > 
> > if sitting in B; git fetch does't update HEAD

You need to set up special refspecs in your B repo, so that git fetch updates refs/heads/* instead of refs/remotes/origin/*. When that is done, a simple 'git fetch' will update your branches (and HEAD as a result).

In short, you should create the B repo using 'git clone --mirror' (which will set up the correct refspecs for you)

...Johan
-- 
Johan Herland, <johan@herland.net>
www.herland.net
Previous: Mahesh Vaidya
Message 3 of 3 in “Git Fetch / updating HEAD”
  1. Mahesh VaidyaJul 17, 2010
  2. Mahesh VaidyaJul 17, 2010
  3. Johan HerlandJul 17, 2010

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.