Skip to contentSkip to conversation

git-reset any branch head

DISCUSSION ZoltánFüzesi 3 participants 5 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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

Zé

#1 lore raw

2009/7/29 ZoltánFüzesi <[email protected]>:

Quoted 2 lines

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

#2 lore raw
Quoted 5 lines · Santi Béjar <santi <at> agolina.net> writes:

2009/7/29 ZoltánFüzesi <zfuzesi <at> eaglet.hu>:

Quoted 2 lines

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

Quoted 7 lines

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é

#3 lore raw
Quoted 15 lines · ZoltánFüzesi
Quoted 5 lines · Santi Béjar <santi <at> agolina.net> writes:

2009/7/29 ZoltánFüzesi <zfuzesi <at> eaglet.hu>:

Quoted 2 lines

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

Quoted 7 lines

git update-ref

or do  you mean with porcelain commands?

HTH,
Santi

Quoted 8 lines

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

Quoted 7 lines

Zé

--
To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 7 lines · Pat Notz <patnotz <at> gmail.com> writes:

I think you simply want:

git branch -f B C

~ Pat

Yes! :)
Thx,
Zé