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

How to rebase and rename?

From
Peter Krefting <peter@softwolves.pp.se>
Date
Feb 3, 2010, 09:05 UTC
Message-ID
<alpine.DEB.2.00.1002030958380.17444@ds9.cixit.se>
Hi!

If I have a repository with a topic branch that is published, and that I want to rebase and republish under a new name, is there an easy way of doing that?

I.e., I want to go from
      ---C---D topic-1
     /
  --A---X---X---B master
to
        ---C---D topic-1
 	  /
      /           ---C'---D' topic-2
     /           /
  --A---X---X---B master
Currently, I do something along the lines of:
  git branch topic-2 topic-1
  git rebase master topic-2

but that feels wrong as it creates the "topic-2" branch pointing the the wrong way first. Is there a way to eliminate that step?

-- 
\\// Peter - http://www.softwolves.pp.se/
Next: Jeff King
Message 1 of 2 in “How to rebase and rename?”
  1. Peter KreftingFeb 3, 2010
  2. Jeff KingFeb 3, 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.