From: John Keeping Date: Fri, 23 May 2014 17:14:07 GMT Subject: Re: Plumbing to rename a ref? Message-ID: <20140523171407.GB2249@serenity.lan> In-Reply-To: On Fri, May 23, 2014 at 10:10:05AM -0700, Junio C Hamano wrote: > John Keeping writes: > > > On Fri, May 23, 2014 at 02:11:55PM +0400, Sergei Organov wrote: > >> Hello, > >> > >> After convertion of a project from CVS to git, I'd like to rename some > >> references in the created git repository (before it's published, so no > >> problems here). Is there a plumbing that would do: > >> > >> git rename-ref > >> > >> for me? > > > > I think the best you can get is two invocations of `git update-ref`: > > > > git update-ref && > > git update-ref -d > > > > Although if you're scripting it the `--stdin` mode may be easier: > > > > git update-ref --stdin <<-\EOF > > create > > delete > > EOF > > > > Note that "" must be a fully-qualified ref (that is, it must > > start with "refs/", so "refs/heads/new_name" for a branch or > > "refs/tags/new_name" for a tag). > > Shouldn't also be a full ref? I tested this before sending the email, and it seemed to do the right thing specifying only the branch name; so it probably /should/ be a full ref, but it seems like it doesn't /need/ to be.