From: Johannes Sixt Date: Mon, 25 Jun 2007 07:16:00 GMT Subject: Re: [PATCH] transplant: move a series of commits to a different parent Message-ID: <467F6BB0.4C7F041E@eudaptics.com> In-Reply-To: <9C4338DC-0C4A-4981-9EC9-2417513F629D@zib.de> Steffen Prohaska wrote: > > On Jun 23, 2007, at 11:04 PM, Alex Riesen wrote: > > >> git-transplant.sh > >> > >> transplant starts with the contents of and puts on top of > >> it the contents of files if they are touched by the series of > >> commits ... If a commit touches a file the content of > >> this file is taken as it is in the commit. No merging is > >> performed. Original authors, commiters, and commit messages are > >> preserved. > >> > > [...] > > # detached head > > git checkout $(git rev-parse onto) && git format-patch --stdout > > --full-index from..to|git am -3 > > No. This one tries to apply the _changes_ between from..to. What I > need is the resulting _content_ of files modified between from..to. Install a graft that points the parent of "from" to "onto", then run git-filter-branch. Like so: $ echo "$(git-rev-parse from^0) $(git-rev-parse onto^0)" \ > .git/info/grafts $ git-filter-branch new-to onto..to (no filters necessary). -- Hannes