All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomas Carnecky <tom@dbservice.com>
To: Brian Foster <brian.foster@innova-card.com>
Cc: git@vger.kernel.org
Subject: Re: [SOLVED] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?
Date: Thu, 12 Aug 2010 14:32:41 +0200	[thread overview]
Message-ID: <4C63E9E9.7070105@dbservice.com> (raw)
In-Reply-To: <201008121416.35887.brian.foster@innova-card.com>

On 8/12/10 2:16 PM, Brian Foster wrote:
>  NO.  ‘get checkout ...’ does not work in a bare repository.
>  (You can modify my trivial posted script to prove this.)
> 
>  However, your comment got me to thinking.  This _does_ work:
> 
>     git reset --soft FETCH_HEAD
> 
>  (And, I presume without testing, so would ‘... v2’ ?)
>  Given that git-reset(1)'s purpose is to change the branch's
>  head (or to change HEAD as I've been incorrectly describing
>  it), that does make sense.

I expected git checkout to work even in a bare repo - as you can see I
don't work that often inside bare repos :).

You should use update-ref instead of reset. The problem with reset is
that it changes the branch and not HEAD. Say initially your mirror had
HEAD as symref pointing to refs/heads/master. When you run reset --soft
v2 your master branch will now point to the same commit as the tag v2
(and HEAD will be still pointing to refs/heads/master). When you use
'git update-ref --no-deref HEAD v2' it will modify HEAD directly and
have it point directly to the same commit as v2 (also called detached HEAD).

tom

  reply	other threads:[~2010-08-12 12:32 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
2010-08-12 12:16       ` [SOLVED] " Brian Foster
2010-08-12 12:32         ` Tomas Carnecky [this message]
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

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

  git send-email \
    --in-reply-to=4C63E9E9.7070105@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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.