# Usability of git-update-ref <headname>

2 messages from 2007-07-04 to 2007-07-04. Participants: Martin Langhoff, Junio C Hamano.
Thread: https://gitlist.dev/t/8850

## Martin Langhoff, 2007-07-04 02:08

Subject: Usability of git-update-ref <headname>
Message-ID: <46a038f90707031908x3fb2eb59ob0a57a33777363fb@mail.gmail.com>
URL: https://gitlist.dev/e/46a038f90707031908x3fb2eb59ob0a57a33777363fb%40mail.gmail.com

```
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, 2007-07-04 04:12

Subject: Re: Usability of git-update-ref <headname>
Message-ID: <7vtzskq01j.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vtzskq01j.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <46a038f90707031908x3fb2eb59ob0a57a33777363fb@mail.gmail.com>

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

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

```
