From: Dennis Kaarsemaker <dennis@kaarsemaker.net>
To: Hans Ginzel <hans@matfyz.cz>
Cc: git@vger.kernel.org
Subject: Re: How to rebase one branch of the merge commit?
Date: Sun, 01 Feb 2015 20:28:28 +0100 [thread overview]
Message-ID: <1422818908.29011.6.camel@kaarsemaker.net> (raw)
In-Reply-To: <20150201184214.GA89666@artax.karlin.mff.cuni.cz>
On zo, 2015-02-01 at 19:42 +0100, Hans Ginzel wrote:
> 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
next prev parent reply other threads:[~2015-02-01 19:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-01 18:42 How to rebase one branch of the merge commit? Hans Ginzel
2015-02-01 19:28 ` Dennis Kaarsemaker [this message]
2015-02-09 11:38 ` Hans Ginzel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1422818908.29011.6.camel@kaarsemaker.net \
--to=dennis@kaarsemaker.net \
--cc=git@vger.kernel.org \
--cc=hans@matfyz.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).