# Git Fetch / updating HEAD

3 messages from 2010-07-17 to 2010-07-17. Participants: Mahesh Vaidya, Johan Herland.
Thread: https://gitlist.dev/t/24421

## Mahesh Vaidya, 2010-07-17 15:32

Subject: Git Fetch / updating HEAD
Message-ID: <AANLkTinuK4gx9SG1VKo_NbkP_QWMCmtsfJgUgfoL_KGo@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTinuK4gx9SG1VKo_NbkP_QWMCmtsfJgUgfoL_KGo%40mail.gmail.com

```
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


Mahesh Vaidya

```

## Mahesh Vaidya, 2010-07-17 15:35

Subject: Re: Git Fetch / updating HEAD
Message-ID: <AANLkTilp5lZn99QZPWSkCHStnRdkGx6mMU2IQBvllaU4@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTilp5lZn99QZPWSkCHStnRdkGx6mMU2IQBvllaU4%40mail.gmail.com
In-Reply-To: <AANLkTinuK4gx9SG1VKo_NbkP_QWMCmtsfJgUgfoL_KGo@mail.gmail.com>

```
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:
> 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
>
>
> Mahesh Vaidya
>



-- 
Thank you and best regards.
Mahesh Vaidya  / 9740500144
http://www.twitter.com/forvaidya

```

## Johan Herland, 2010-07-17 16:11

Subject: Re: Git Fetch / updating HEAD
Message-ID: <201007171811.13624.johan@herland.net>
URL: https://gitlist.dev/e/201007171811.13624.johan%40herland.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:
> > 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

```
