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

Re: [Q] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?

From
Tomas Carnecky <tom@dbservice.com>
Date
Aug 12, 2010, 08:33 UTC
Message-ID
<4C63B1C9.6050801@dbservice.com>
In-Reply-To
<201008120954.27648.brian.foster@innova-card.com>
On 8/12/10 9:54 AM, Brian Foster wrote:
Show 28 quoted lines
> 
>  Bare repository ORIG's master looks like this:
> 
>    o--o--o--o--v1--o--v2--o--o--o HEAD
> 
>  where v1 and v2 are (annotated) tagged commits.
> 
>  Repository SLAVE is a mirror clone of ORIG which
>  (very deliberately!) lags behind (i.e., its HEAD
>  is one of the earlier (and usually tagged) commits
>  on ORIG).  SLAVE's master was like this:
> 
>    o--o--o--o--v1 HEAD
> 
>  We wanted to update its HEAD to v2, so did:
> 
>    git fetch ORIG tag v2
> 
>  This gave us:
> 
>    o--o--o--o--v1 HEAD
>                  \ 
>                   o--v2
> 
>  It did not update SLAVE's HEAD to v2, which we wanted.
>  This was worked-around by editing refs/heads/master(?)
>  but we don't want to do that again (esp. since we got
>  it wrong the first time (Thank you back-ups!)).

Fetch only fetches commits. It doesn't update any local refs (other than FETCH_HEAD). If you want to switch HEAD to that new tag, use checkout.

Show 6 quoted lines
>  Whilst we want to switch to a push from ORIG to SLAVE
>  model, until that happens (there are some IT issues),
>  we are still fetching on SLAVE from ORIG.  Hence, how
>  can we avoid the above issue; that is, what should we
>  have done?  Searching various docs has failed to find
>  any clew or answer.

Is SLAVE a bare repo? If not, please see https://git.wiki.kernel.org/index.php/GitFaq#non-bare.

tom
Previous: Brian FosterNext: Brian Foster
Message 2 of 11 in “[Q] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?”
  1. Brian FosterAug 12, 2010
  2. Tomas CarneckyAug 12, 2010
  3. Brian FosterAug 12, 2010
  4. Tomas CarneckyAug 12, 2010
  5. [SOLVED] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?Brian Foster, Aug 12, 2010
  6. Tomas CarneckyAug 12, 2010
  7. Brian FosterAug 12, 2010
  8. Tomas CarneckyAug 12, 2010
  9. Brian FosterAug 13, 2010
  10. Brandon CaseyAug 12, 2010
  11. Brian FosterAug 13, 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.