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

Re: How to do a reverse rebase?

From
Llinux@horizon.com <linux@horizon.com>
Date
Aug 20, 2007, 10:39 UTC
Message-ID
<20070820103943.6046.qmail@science.horizon.com>
In-Reply-To
<20070820055809.GZ27913@spearce.org>
> I don't think so.  To do the merge of those files we need a working
> directory to operate in; that working directory is the one you have.
> It sounds like what you want is this:
Show 5 quoted lines
>	old=`git symbolic-ref HEAD` &&
>	git checkout HEAD^0 &&
>	git cherry-pick debug_hack &&
>	git branch -f debug_hack HEAD &&
>	git checkout $old

Er, actually, I don't want the messing about with $old. At the end of the day, I want to be on the tip of the rebased work.

The problem is that git-cherry-pick only oves a single comit, so if I have a stack, it's annoying.

It's more like:
	git checkout HEAD^0 &&
	for i in `git-rev-list --reverse ..debug_hack`; do
		git-cherry-pick $i
	done &&
	git branch -D debug_hack &&
	git checkout -b debug_hack
Previous: Junio C HamanoNext: Johannes Sixt
Message 4 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.