# git-reset any branch head

5 messages from 2009-07-29 to 2009-07-29. Participants: ZoltánFüzesi, Santi Béjar, Pat Notz.
Thread: https://gitlist.dev/t/20277

## ZoltánFüzesi, 2009-07-29 10:05

Subject: git-reset any branch head
Message-ID: <loom.20090729T095925-556@post.gmane.org>
URL: https://gitlist.dev/e/loom.20090729T095925-556%40post.gmane.org

```
Hi, sometimes it would be nice to reset not only the current,
but any given branch head. What do you think?

Zé

```

## Santi Béjar, 2009-07-29 11:16

Subject: Re: git-reset any branch head
Message-ID: <adf1fd3d0907290416q341ea6abi97828e75c50b7191@mail.gmail.com>
URL: https://gitlist.dev/e/adf1fd3d0907290416q341ea6abi97828e75c50b7191%40mail.gmail.com
In-Reply-To: <loom.20090729T095925-556@post.gmane.org>

```
2009/7/29 ZoltánFüzesi <zfuzesi@eaglet.hu>:
> Hi, sometimes it would be nice to reset not only the current,
> but any given branch head. What do you think?

git update-ref

or do  you mean with porcelain commands?

HTH,
Santi

```

## ZoltánFüzesi, 2009-07-29 11:37

Subject: Re: git-reset any branch head
Message-ID: <loom.20090729T112521-558@post.gmane.org>
URL: https://gitlist.dev/e/loom.20090729T112521-558%40post.gmane.org
In-Reply-To: <adf1fd3d0907290416q341ea6abi97828e75c50b7191@mail.gmail.com>

```
Santi Béjar <santi <at> agolina.net> writes:

> 
> 2009/7/29 ZoltánFüzesi <zfuzesi <at> eaglet.hu>:
> > Hi, sometimes it would be nice to reset not only the current,
> > but any given branch head. What do you think?
> 
> git update-ref
> 
> or do  you mean with porcelain commands?
> 
> HTH,
> Santi
> 

Suppose I have 3 branches A, B, C, and A is checked out.
I would like to set B's head to point to C's with a command like:
git-reset --head B C

Currently I can achieve it by 2 commands:
git-checkout B
git-reset --hard C

Zé

```

## Pat Notz, 2009-07-29 12:33

Subject: Re: git-reset any branch head
Message-ID: <1cd1989b0907290533q1553773euce67dff47db546a7@mail.gmail.com>
URL: https://gitlist.dev/e/1cd1989b0907290533q1553773euce67dff47db546a7%40mail.gmail.com
In-Reply-To: <loom.20090729T112521-558@post.gmane.org>

```
On Wed, Jul 29, 2009 at 5:37 AM, ZoltánFüzesi<zfuzesi@eaglet.hu> wrote:
> Santi Béjar <santi <at> agolina.net> writes:
>
>>
>> 2009/7/29 ZoltánFüzesi <zfuzesi <at> eaglet.hu>:
>> > Hi, sometimes it would be nice to reset not only the current,
>> > but any given branch head. What do you think?
>>
>> git update-ref
>>
>> or do  you mean with porcelain commands?
>>
>> HTH,
>> Santi
>>
>
> Suppose I have 3 branches A, B, C, and A is checked out.
> I would like to set B's head to point to C's with a command like:
> git-reset --head B C
>
> Currently I can achieve it by 2 commands:
> git-checkout B
> git-reset --hard C
>

I think you simply want:

   git branch -f B C

~ Pat

> Zé
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

```

## ZoltánFüzesi, 2009-07-29 12:39

Subject: Re: git-reset any branch head
Message-ID: <loom.20090729T123739-772@post.gmane.org>
URL: https://gitlist.dev/e/loom.20090729T123739-772%40post.gmane.org
In-Reply-To: <1cd1989b0907290533q1553773euce67dff47db546a7@mail.gmail.com>

```
Pat Notz <patnotz <at> gmail.com> writes:

> 
> I think you simply want:
> 
>    git branch -f B C
> 
> ~ Pat
> 

Yes! :)
Thx,
Zé

```
