git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Tomas Carnecky <tom@dbservice.com>
To: Brian Foster <brian.foster@innova-card.com>
Cc: git@vger.kernel.org
Subject: Re: [Q] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?
Date: Thu, 12 Aug 2010 13:05:29 +0200	[thread overview]
Message-ID: <4C63D579.507@dbservice.com> (raw)
In-Reply-To: <201008121238.51983.brian.foster@innova-card.com>

On 8/12/10 12:38 PM, Brian Foster wrote:
> On Thursday 12 August 2010 10:33:13 Tomas Carnecky wrote:
> 
> Tom,
>  Thanks for the reply, but I suspect you didn't read
>  the problem correctly ....

I suspect I did but did not explain correctly (though I didn't realize
mirror implies bare, my bad).

> 
>> On 8/12/10 9:54 AM, Brian Foster wrote:
>>>  Bare repository ORIG's master looks like this:
>>> [ ... ] 
>>>  Repository SLAVE is a mirror clone of ORIG which
> NOTE.......................^^^^^^
>> [ ... ] 
>> 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.

Oh boy, that explanation is really bad -.- What I meant is that if you
don't supply the <dst> part of the refspec it will only update
FETCH_HEAD. So 'git fetch origin master' will not update anything but
FETCH_HEAD.

>  No, a fetch in a mirror, when fetching all the way
>  to the HEAD (e.g., a simple `git fetch origin'),
>  does update the branch.  (You can easily modify the
>  script I included to prove this.)

There are different ways to invoke git fetch. Either way, fetch will
never modify HEAD. However, it can modify the branch that HEAD is
pointing to (in case HEAD is a symref). But you are not fetching a
branch, you are fetching a tag. So you need to use checkout after you
fetch it. Either 'git checkout FETCH_HEAD' or 'git checkout v2'.

tom

  reply	other threads:[~2010-08-12 11:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-12  7:54 [Q] `git fetch tag NAME' into mirror repo does not update HEAD, what to do? Brian Foster
2010-08-12  8:33 ` Tomas Carnecky
2010-08-12 10:38   ` Brian Foster
2010-08-12 11:05     ` Tomas Carnecky [this message]
2010-08-12 12:16       ` [SOLVED] " Brian Foster
2010-08-12 12:32         ` Tomas Carnecky
2010-08-12 13:22           ` Brian Foster
2010-08-12 13:34             ` Tomas Carnecky
2010-08-13  7:03               ` Brian Foster
2010-08-12 17:02 ` [Q] " Brandon Casey
2010-08-13  7:22   ` Brian Foster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C63D579.507@dbservice.com \
    --to=tom@dbservice.com \
    --cc=brian.foster@innova-card.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).