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

Re: How to rebase one branch of the merge commit?

From
Dennis Kaarsemaker <dennis@kaarsemaker.net>
Date
Feb 1, 2015, 19:28 UTC
Message-ID
<1422818908.29011.6.camel@kaarsemaker.net>
In-Reply-To
<20150201184214.GA89666@artax.karlin.mff.cuni.cz>
On zo, 2015-02-01 at 19:42 +0100, Hans Ginzel wrote:
Show 21 quoted lines
> Hello!
> 
> Suppose following git history:
> 
> A–M–C
>   /
> B
> 
> How to achieve this with commits metadata preserving?
> 
> A–M'–C'
>   /
> B'
> 
> I did
> 
> git checkout B
> git add something_not_in_other_commits
> git commit --amend
> 
> So I have B'. How to continue, please? My git version is 1.7.1 (Centos 6.5).
Assuming you have a branch pointing to C and no uncommitted changes:
1) git checkout branch-that-points-to-c
2) git rev-parse branch-that-point-to-c
3) git reset --hard A
4) git merge B'
5) git cherry-pick sha1-that-was-the-output-of-step-2
-- 
Dennis Kaarsemaker
www.kaarsemaker.net
Previous: Hans GinzelNext: Hans Ginzel
Message 2 of 3 in “How to rebase one branch of the merge commit?”
  1. Hans GinzelFeb 1, 2015
  2. Dennis KaarsemakerFeb 1, 2015
  3. Hans GinzelFeb 9, 2015

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.