threads / discuss / 8850

Usability of git-update-ref <headname>

Subject: Usability of git-update-ref <headname>

## tl;dr

2 messages between Jul 4, 2007 and Jul 4, 2007.

replies: 1people: 2as markdown or json

Martin Langhoff· Jul 4, 2007, 02:08 UTC · lore
A few times now I've done the following
  # I think I'm on master, but I'm acually on maint
  git-branch foo-feature
  git-checkout foo-feature
  # realise I've branched in the wring place
  git-update-ref foo-feature master
And from that point, all sorts of things go weird, because I should have said
  git-update-ref refs/heads/foo-feature master

to fix it up I have to manually rm .git/foo-feature -- and I can't see a way to remove a ref with git-update-ref, so if I was using packed refs I'd be in trouble ;-)

Am I using the wrong command? I'd be happy to remove the bogus head and create a new one, but I don't think we have git-rm-ref.

m
Junio C Hamano· Jul 4, 2007, 04:12 UTC · re: Martin Langhoff · lore

Re: Usability of git-update-ref <headname>

"Martin Langhoff" <martin.langhoff@gmail.com> writes:
> Am I using the wrong command? I'd be happy to remove the bogus head
> and create a new one, but I don't think we have git-rm-ref.

Yes you are. Forget about update-ref. That is strictly for script consumption.

Show 5 quoted lines
>  # I think I'm on master, but I'm acually on maint
>  git-branch foo-feature
>  git-checkout foo-feature
>
>  # realise I've branched in the wrong place
   $ git reset --soft master

← back to recent threads