threads / discuss / 20277

git-reset any branch head

Subject: git-reset any branch head

## tl;dr

5 messages between Jul 29, 2009 and Jul 29, 2009.

replies: 4people: 3as markdown or json

Santi Béjar· Jul 29, 2009, 11:16 UTC · re: ZoltánFüzesi · lore

Re: git-reset any branch head

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· Jul 29, 2009, 11:37 UTC · re: Santi Béjar · lore

Re: git-reset any branch head

Santi Béjar <santi <at> agolina.net> writes:
Show 12 quoted lines
> 
> 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· Jul 29, 2009, 12:33 UTC · re: ZoltánFüzesi · lore

Re: git-reset any branch head

On Wed, Jul 29, 2009 at 5:37 AM, ZoltánFüzesi<zfuzesi@eaglet.hu> wrote:
Show 23 quoted lines
> 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
Show 7 quoted lines
> 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
>

← back to recent threads