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

Re: Is rebase always destructive?

From
Robin Rosenberg <robin.rosenberg.lists@dewire.com>
Date
Dec 1, 2008, 20:19 UTC
Message-ID
<200812012119.03372.robin.rosenberg.lists@dewire.com>
In-Reply-To
<slrngj8884.2srb.csaba-ml@beastie.creo.hu>
måndag 01 december 2008 18:37:43 skrev Csaba Henk:
Show 12 quoted lines
> On 2008-12-01, Nick Andrew <nick@nick-andrew.net> wrote:
> > On Mon, Dec 01, 2008 at 11:41:39AM +0000, Csaba Henk wrote:
> >> I can't see any option for rebase which would yield this cp-like
> >> behaviour. Am I missing something?
> >
> > How about this:
> >
> > git checkout topic
> > git branch keepme
> > git rebase master
> 
> OK, thanks guys, now I'm enlightened (a little bit more than before).

And if you forgot to create the keepme branch you can access the previous version using the topic@{1} or topic@{'1 hour ago'} etc. This uses the reflog that tracks all "versions" of your branch. Keeping gitk running is nice way to see previous versions (press F5 after rebase).

-- robin
Previous: Csaba HenkNext: Andreas Ericsson
Message 5 of 6 in “Is rebase always destructive?”
  1. Csaba HenkDec 1, 2008
  2. Johan HerlandDec 1, 2008
  3. Nick AndrewDec 1, 2008
  4. Csaba HenkDec 1, 2008
  5. Robin RosenbergDec 1, 2008
  6. Andreas EricssonDec 1, 2008

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.