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

How to do a reverse rebase?

From
Llinux@horizon.com <linux@horizon.com>
Date
Aug 20, 2007, 05:32 UTC
Message-ID
<20070820053237.9349.qmail@science.horizon.com>

Okay, this is picayune whining, but when you've fixed all the big bugs...

I don't want to rebase HEAD on *that*, but rather rebase *that* on top of the current HEAD.

Sometimes I have a little debug hack on a branch by itself, and I discover that I need it again, so I want to rebase it on top of current development.

But there's been a LOT of development in the meantime.  And if I do
git-rebase HEAD debug_hack

git first checks out debug_hack. This takes a while and, more importantly, every file modified in HEAD...debug_hack has its timestamp touched and make(1) insists on recompiling it.

I want to only modify the three files that are touched on the debug_hack branch, so my recompile times aren't too long.

Currently, when I remember, I'll use git-cherry-pick and manually rename branches.

Is there an easier way?  Or should I just learn StGit?
Next: Shawn O. Pearce
Message 1 of 5 in “How to do a reverse rebase?”
  1. linux@horizon.comAug 20, 2007
  2. Shawn O. PearceAug 20, 2007
  3. Junio C HamanoAug 20, 2007
  4. linux@horizon.comAug 20, 2007
  5. Johannes SixtAug 20, 2007

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.