git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: creating a new branch without an ancestor

From
Jay Soffian <jaysoffian@gmail.com>
Date
Feb 5, 2010, 03:32 UTC
Message-ID
<76718491002041932m3398abdel85bd1f4e1eb96899@mail.gmail.com>
In-Reply-To
<20100205032429.GA23285@cthulhu>
On Thu, Feb 4, 2010 at 10:24 PM, Larry D'Anna <larry@elder-gods.org> wrote:
Show 17 quoted lines
> * Michael Wookey (michaelwookey@gmail.com) [100204 22:20]:
>> Maybe I'm missing something from reading the docs, but I couldn't see
>> how to create a new branch in an existing repo that has no ancestor. I
>> would like to do something like what git.git does with some of the
>> other ancillary branches like "man", "html", and "todo".
>>
>> I was hoping to do something like "git branch --no-ancestor
>> new-branch-name" but didn't see anything in the documentation that
>> describes the necessary branch options.
>>
>> Or, am I looking in the wrong place?
>
> git symbolic-ref HEAD refs/heads/whatever
>
> That'll leave your index and working tree alone of course, so if you did a
> commit right after that it would match the content of your current branch but
> not the history.

You can also create the branch in a new repo, then just fetch that into your existing repo.

j.
Previous: Larry D'AnnaNext: Wesley J. Landaker
Message 3 of 4 in “creating a new branch without an ancestor”
  1. Michael WookeyFeb 5, 2010
  2. Larry D'AnnaFeb 5, 2010
  3. Jay SoffianFeb 5, 2010
  4. Wesley J. LandakerFeb 5, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.